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
53dce17b
Unverified
Commit
53dce17b
authored
Mar 10, 2020
by
Zachary Anderson
Committed by
GitHub
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Fallback discovery: Don't crash when an Isolate has no root library (#52354)
parent
d19c4434
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
fallback_discovery.dart
packages/flutter_tools/lib/src/ios/fallback_discovery.dart
+1
-1
fallback_discovery_test.dart
...tools/test/general.shard/ios/fallback_discovery_test.dart
+25
-0
No files found.
packages/flutter_tools/lib/src/ios/fallback_discovery.dart
View file @
53dce17b
...
...
@@ -167,7 +167,7 @@ class FallbackDiscovery {
throw
Exception
(
'Expected Isolate but found Sentinel:
$isolateResponse
'
);
}
final
LibraryRef
library
=
(
isolateResponse
as
Isolate
).
rootLib
;
if
(
library
.
uri
.
startsWith
(
'package:
$packageName
'
))
{
if
(
library
!=
null
&&
library
.
uri
.
startsWith
(
'package:
$packageName
'
))
{
UsageEvent
(
_kEventName
,
'success'
,
...
...
packages/flutter_tools/test/general.shard/ios/fallback_discovery_test.dart
View file @
53dce17b
...
...
@@ -67,6 +67,31 @@ void main() {
),
Uri
.
parse
(
'http://localhost:1'
));
});
testUsingContext
(
'Selects assumed port when another isolate has no root library'
,
()
async
{
when
(
mockVmService
.
getVM
()).
thenAnswer
((
Invocation
invocation
)
async
{
return
VM
()..
isolates
=
<
IsolateRef
>[
IsolateRef
()..
id
=
'1'
,
IsolateRef
()..
id
=
'2'
,
];
});
when
(
mockVmService
.
getIsolate
(
'1'
)).
thenAnswer
((
Invocation
invocation
)
async
{
return
Isolate
()
..
rootLib
=
null
;
});
when
(
mockVmService
.
getIsolate
(
'2'
)).
thenAnswer
((
Invocation
invocation
)
async
{
return
Isolate
()
..
rootLib
=
(
LibraryRef
()..
uri
=
'package:hello/main.dart'
);
});
expect
(
await
fallbackDiscovery
.
discover
(
assumedDevicePort:
23
,
deivce:
null
,
hostVmservicePort:
1
,
packageId:
null
,
usesIpv6:
false
,
packageName:
'hello'
,
),
Uri
.
parse
(
'http://localhost:1'
));
});
testUsingContext
(
'Selects mdns discovery if VM service connecton fails due to Sentinel'
,
()
async
{
when
(
mockVmService
.
getVM
()).
thenAnswer
((
Invocation
invocation
)
async
{
return
VM
()..
isolates
=
<
IsolateRef
>[
...
...
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