Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
6397c022
Commit
6397c022
authored
Jan 10, 2020
by
Kate Lovett
Committed by
Flutter GitHub Bot
Jan 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding error handling for SocketExceptions to local comparator (#48517)
parent
fca59175
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
flutter_goldens.dart
packages/flutter_goldens/lib/flutter_goldens.dart
+9
-1
flutter_goldens_test.dart
packages/flutter_goldens/test/flutter_goldens_test.dart
+12
-2
No files found.
packages/flutter_goldens/lib/flutter_goldens.dart
View file @
6397c022
...
...
@@ -564,7 +564,15 @@ class FlutterLocalFileComparator extends FlutterGoldenFileComparator with LocalC
return
FlutterSkippingGoldenFileComparator
(
baseDirectory
.
uri
,
goldens
,
'No network connection available for contacting Gold.'
,
'OSError occurred, could not reach Gold. '
'Switching to FlutterSkippingGoldenFileComparator.'
,
);
}
on
io
.
SocketException
catch
(
_
)
{
return
FlutterSkippingGoldenFileComparator
(
baseDirectory
.
uri
,
goldens
,
'SocketException occurred, could not reach Gold. '
'Switching to FlutterSkippingGoldenFileComparator.'
,
);
}
...
...
packages/flutter_goldens/test/flutter_goldens_test.dart
View file @
6397c022
...
...
@@ -871,9 +871,19 @@ void main() {
final
MockDirectory
mockDirectory
=
MockDirectory
();
when
(
mockDirectory
.
existsSync
()).
thenReturn
(
true
);
when
(
mockDirectory
.
uri
).
thenReturn
(
Uri
.
parse
(
'/flutter'
));
when
(
mockSkiaClient
.
getExpectations
())
.
thenAnswer
((
_
)
=>
throw
const
OSError
(
'Can
\'
t reach Gold'
));
FlutterGoldenFileComparator
comparator
=
await
FlutterLocalFileComparator
.
fromDefaultComparator
(
platform
,
goldens:
mockSkiaClient
,
baseDirectory:
mockDirectory
,
);
expect
(
comparator
.
runtimeType
,
FlutterSkippingGoldenFileComparator
);
when
(
mockSkiaClient
.
getExpectations
())
.
thenAnswer
((
_
)
=>
throw
const
OSError
(
));
final
FlutterGoldenFileComparator
comparator
=
await
FlutterLocalFileComparator
.
fromDefaultComparator
(
.
thenAnswer
((
_
)
=>
throw
const
SocketException
(
'Can
\'
t reach Gold'
));
comparator
=
await
FlutterLocalFileComparator
.
fromDefaultComparator
(
platform
,
goldens:
mockSkiaClient
,
baseDirectory:
mockDirectory
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment