Unverified Commit 3ce6c1f4 authored by Dan Field's avatar Dan Field Committed by GitHub

[flutter drive] Do not start dds if --no-dds (#81784)

parent f33499df
...@@ -204,19 +204,21 @@ class FlutterDriverService extends DriverService { ...@@ -204,19 +204,21 @@ class FlutterDriverService extends DriverService {
} }
_vmServiceUri = uri.toString(); _vmServiceUri = uri.toString();
_device = device; _device = device;
try { if (debuggingOptions.enableDds) {
await device.dds.startDartDevelopmentService( try {
uri, await device.dds.startDartDevelopmentService(
debuggingOptions.ddsPort, uri,
ipv6, debuggingOptions.ddsPort,
debuggingOptions.disableServiceAuthCodes, ipv6,
logger: _logger, debuggingOptions.disableServiceAuthCodes,
); logger: _logger,
_vmServiceUri = device.dds.uri.toString(); );
} on dds.DartDevelopmentServiceException { _vmServiceUri = device.dds.uri.toString();
// If there's another flutter_tools instance still connected to the target } on dds.DartDevelopmentServiceException {
// application, DDS will already be running remotely and this call will fail. // If there's another flutter_tools instance still connected to the target
// This can be ignored to continue to use the existing remote DDS instance. // 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, device: _device); _vmService = await _vmServiceConnector(uri, device: _device);
final DeviceLogReader logReader = await device.getLogReader(app: _applicationPackage); final DeviceLogReader logReader = await device.getLogReader(app: _applicationPackage);
......
...@@ -222,7 +222,7 @@ void main() { ...@@ -222,7 +222,7 @@ void main() {
command: <String>['dart', 'foo.test', '-rexpanded'], command: <String>['dart', 'foo.test', '-rexpanded'],
exitCode: 11, exitCode: 11,
environment: <String, String>{ environment: <String, String>{
'VM_SERVICE_URL': 'http://127.0.0.1:1234/' 'VM_SERVICE_URL': 'http://127.0.0.1:63426/1UasC_ihpXY=/'
}, },
), ),
]); ]);
...@@ -230,8 +230,12 @@ void main() { ...@@ -230,8 +230,12 @@ void main() {
final Device device = FakeDevice(LaunchResult.succeeded( final Device device = FakeDevice(LaunchResult.succeeded(
observatoryUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), observatoryUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'),
)); ));
final FakeDartDevelopmentService dds = device.dds as FakeDartDevelopmentService;
expect(dds.started, false);
await driverService.start(BuildInfo.profile, device, DebuggingOptions.enabled(BuildInfo.profile, enableDds: false), true); await driverService.start(BuildInfo.profile, device, DebuggingOptions.enabled(BuildInfo.profile, enableDds: false), true);
expect(dds.started, false);
final int testResult = await driverService.startTest( final int testResult = await driverService.startTest(
'foo.test', 'foo.test',
<String>[], <String>[],
...@@ -240,6 +244,7 @@ void main() { ...@@ -240,6 +244,7 @@ void main() {
); );
expect(testResult, 11); expect(testResult, 11);
expect(dds.started, false);
}); });
testWithoutContext('Safely stops and uninstalls application', () async { testWithoutContext('Safely stops and uninstalls application', () async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment