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
735f6eec
Unverified
Commit
735f6eec
authored
Oct 28, 2020
by
Jonah Williams
Committed by
GitHub
Oct 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] support ws scheme in use-existing-app (#69244)
parent
4aad058a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
drive_service.dart
packages/flutter_tools/lib/src/drive/drive_service.dart
+9
-3
drive_service_test.dart
...er_tools/test/general.shard/drive/drive_service_test.dart
+28
-0
No files found.
packages/flutter_tools/lib/src/drive/drive_service.dart
View file @
735f6eec
...
...
@@ -191,11 +191,17 @@ class FlutterDriverService extends DriverService {
DebuggingOptions
debuggingOptions
,
bool
ipv6
,
)
async
{
_vmServiceUri
=
vmServiceUri
.
toString
();
Uri
uri
;
if
(
vmServiceUri
.
scheme
==
'ws'
)
{
uri
=
vmServiceUri
.
replace
(
scheme:
'http'
,
path:
vmServiceUri
.
path
.
replaceFirst
(
'ws/'
,
''
));
}
else
{
uri
=
vmServiceUri
;
}
_vmServiceUri
=
uri
.
toString
();
_device
=
device
;
try
{
await
device
.
dds
.
startDartDevelopmentService
(
vmServiceU
ri
,
u
ri
,
debuggingOptions
.
ddsPort
,
ipv6
,
debuggingOptions
.
disableServiceAuthCodes
,
...
...
@@ -206,7 +212,7 @@ class FlutterDriverService extends DriverService {
// application, DDS will already be running remotely and this call will fail.
// This can be ignored to continue to use the existing remote DDS instance.
}
_vmService
=
await
_vmServiceConnector
(
Uri
.
parse
(
_vmServiceUri
)
,
device:
_device
);
_vmService
=
await
_vmServiceConnector
(
uri
,
device:
_device
);
final
DeviceLogReader
logReader
=
await
device
.
getLogReader
(
app:
_applicationPackage
);
logReader
.
logLines
.
listen
(
_logger
.
printStatus
);
...
...
packages/flutter_tools/test/general.shard/drive/drive_service_test.dart
View file @
735f6eec
...
...
@@ -280,6 +280,31 @@ void main() {
await
driverService
.
stop
();
});
testWithoutContext
(
'Can connect to existing application using ws URI'
,
()
async
{
final
FakeVmServiceHost
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
FakeVmServiceRequest
>[
getVM
,
getVM
,
const
FakeVmServiceRequest
(
method:
'ext.flutter.exit'
,
args:
<
String
,
Object
>{
'isolateId'
:
'1'
,
}
)
]);
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[]);
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
(
'Does not call flutterExit on device types that do not support it'
,
()
async
{
final
FakeVmServiceHost
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
FakeVmServiceRequest
>[
getVM
,
...
...
@@ -321,6 +346,9 @@ FlutterDriverService setUpDriverService({
Object
compression
,
Device
device
,
})
async
{
if
(
httpUri
.
scheme
!=
'http'
)
{
fail
(
'Expected an HTTP scheme, 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