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
111c6ab1
Unverified
Commit
111c6ab1
authored
May 10, 2021
by
Dan Field
Committed by
GitHub
May 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix reuseApplication when ws URI does not end with `/` (#82066)
parent
b8a24567
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
1 deletion
+53
-1
drive_service.dart
packages/flutter_tools/lib/src/drive/drive_service.dart
+3
-1
drive_service_test.dart
...er_tools/test/general.shard/drive/drive_service_test.dart
+50
-0
No files found.
packages/flutter_tools/lib/src/drive/drive_service.dart
View file @
111c6ab1
...
...
@@ -198,7 +198,9 @@ class FlutterDriverService extends DriverService {
)
async
{
Uri
uri
;
if
(
vmServiceUri
.
scheme
==
'ws'
)
{
uri
=
vmServiceUri
.
replace
(
scheme:
'http'
,
path:
vmServiceUri
.
path
.
replaceFirst
(
'ws/'
,
''
));
final
List
<
String
>
segments
=
vmServiceUri
.
pathSegments
.
toList
();
segments
.
remove
(
'ws'
);
uri
=
vmServiceUri
.
replace
(
scheme:
'http'
,
path:
segments
.
join
(
'/'
));
}
else
{
uri
=
vmServiceUri
;
}
...
...
packages/flutter_tools/test/general.shard/drive/drive_service_test.dart
View file @
111c6ab1
...
...
@@ -354,6 +354,53 @@ void main() {
await
driverService
.
stop
();
});
testWithoutContext
(
'Can connect to existing application using ws URI (no trailing slash)'
,
()
async
{
final
FakeVmServiceHost
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
FakeVmServiceRequest
>[
getVM
,
getVM
,
const
FakeVmServiceRequest
(
method:
'ext.flutter.exit'
,
args:
<
String
,
Object
>{
'isolateId'
:
'1'
,
}
)
]);
final
FakeProcessManager
processManager
=
FakeProcessManager
.
empty
();
final
DriverService
driverService
=
setUpDriverService
(
processManager:
processManager
,
vmService:
fakeVmServiceHost
.
vmService
);
final
FakeDevice
device
=
FakeDevice
(
LaunchResult
.
failed
());
await
driverService
.
reuseApplication
(
Uri
.
parse
(
'ws://127.0.0.1:63426/1UasC_ihpXY=/ws'
),
device
,
DebuggingOptions
.
enabled
(
BuildInfo
.
debug
),
false
,
);
await
driverService
.
stop
();
});
testWithoutContext
(
'Can connect to existing application using ws URI (no trailing slash, ws in auth code)'
,
()
async
{
final
FakeVmServiceHost
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
FakeVmServiceRequest
>[
getVM
,
getVM
,
const
FakeVmServiceRequest
(
method:
'ext.flutter.exit'
,
args:
<
String
,
Object
>{
'isolateId'
:
'1'
,
}
)
]);
final
FakeProcessManager
processManager
=
FakeProcessManager
.
empty
();
final
DriverService
driverService
=
setUpDriverService
(
processManager:
processManager
,
vmService:
fakeVmServiceHost
.
vmService
);
final
FakeDevice
device
=
FakeDevice
(
LaunchResult
.
failed
());
await
driverService
.
reuseApplication
(
Uri
.
parse
(
'ws://127.0.0.1:63426/wsasC_ihpXY=/ws'
),
device
,
DebuggingOptions
.
enabled
(
BuildInfo
.
debug
),
false
,
);
await
driverService
.
stop
();
});
testWithoutContext
(
'Does not call flutterExit on device types that do not support it'
,
()
async
{
final
FakeVmServiceHost
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
FakeVmServiceRequest
>[
...
...
@@ -401,6 +448,9 @@ FlutterDriverService setUpDriverService({
if
(
httpUri
.
scheme
!=
'http'
)
{
fail
(
'Expected an HTTP scheme, found
$httpUri
'
);
}
if
(
httpUri
.
path
.
endsWith
(
'/ws'
))
{
fail
(
'Expected HTTP uri to not contain `/ws`, found
$httpUri
'
);
}
return
vmService
;
}
);
...
...
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