[flutter drive] Do not start dds if --no-dds (#81784)
This commit is contained in:
@@ -204,19 +204,21 @@ class FlutterDriverService extends DriverService {
|
||||
}
|
||||
_vmServiceUri = uri.toString();
|
||||
_device = device;
|
||||
try {
|
||||
await device.dds.startDartDevelopmentService(
|
||||
uri,
|
||||
debuggingOptions.ddsPort,
|
||||
ipv6,
|
||||
debuggingOptions.disableServiceAuthCodes,
|
||||
logger: _logger,
|
||||
);
|
||||
_vmServiceUri = device.dds.uri.toString();
|
||||
} on dds.DartDevelopmentServiceException {
|
||||
// If there's another flutter_tools instance still connected to the target
|
||||
// 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.
|
||||
if (debuggingOptions.enableDds) {
|
||||
try {
|
||||
await device.dds.startDartDevelopmentService(
|
||||
uri,
|
||||
debuggingOptions.ddsPort,
|
||||
ipv6,
|
||||
debuggingOptions.disableServiceAuthCodes,
|
||||
logger: _logger,
|
||||
);
|
||||
_vmServiceUri = device.dds.uri.toString();
|
||||
} on dds.DartDevelopmentServiceException {
|
||||
// If there's another flutter_tools instance still connected to the target
|
||||
// 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);
|
||||
final DeviceLogReader logReader = await device.getLogReader(app: _applicationPackage);
|
||||
|
||||
@@ -222,7 +222,7 @@ void main() {
|
||||
command: <String>['dart', 'foo.test', '-rexpanded'],
|
||||
exitCode: 11,
|
||||
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() {
|
||||
final Device device = FakeDevice(LaunchResult.succeeded(
|
||||
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);
|
||||
expect(dds.started, false);
|
||||
|
||||
final int testResult = await driverService.startTest(
|
||||
'foo.test',
|
||||
<String>[],
|
||||
@@ -240,6 +244,7 @@ void main() {
|
||||
);
|
||||
|
||||
expect(testResult, 11);
|
||||
expect(dds.started, false);
|
||||
});
|
||||
|
||||
testWithoutContext('Safely stops and uninstalls application', () async {
|
||||
|
||||
Reference in New Issue
Block a user