Unverified Commit fc59f01e authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] ensure allowExistingDdsInstance param is always non-null (#74091)

parent e7aced17
...@@ -222,7 +222,7 @@ class FlutterDevice { ...@@ -222,7 +222,7 @@ class FlutterDevice {
int ddsPort, int ddsPort,
bool disableServiceAuthCodes = false, bool disableServiceAuthCodes = false,
bool disableDds = false, bool disableDds = false,
bool allowExistingDdsInstance = false, @required bool allowExistingDdsInstance,
bool ipv6 = false, bool ipv6 = false,
}) { }) {
final Completer<void> completer = Completer<void>(); final Completer<void> completer = Completer<void>();
...@@ -1217,7 +1217,7 @@ abstract class ResidentRunner { ...@@ -1217,7 +1217,7 @@ abstract class ResidentRunner {
Restart restart, Restart restart,
CompileExpression compileExpression, CompileExpression compileExpression,
GetSkSLMethod getSkSLMethod, GetSkSLMethod getSkSLMethod,
bool allowExistingDdsInstance, @required bool allowExistingDdsInstance,
}) async { }) async {
if (!debuggingOptions.debuggingEnabled) { if (!debuggingOptions.debuggingEnabled) {
throw 'The service protocol is not enabled.'; throw 'The service protocol is not enabled.';
......
...@@ -73,7 +73,9 @@ class ColdRunner extends ResidentRunner { ...@@ -73,7 +73,9 @@ class ColdRunner extends ResidentRunner {
if (debuggingOptions.debuggingEnabled) { if (debuggingOptions.debuggingEnabled) {
try { try {
await Future.wait(<Future<void>>[ await Future.wait(<Future<void>>[
connectToServiceProtocol(), connectToServiceProtocol(
allowExistingDdsInstance: false,
),
serveDevToolsGracefully( serveDevToolsGracefully(
devToolsServerAddress: debuggingOptions.devToolsServerAddress, devToolsServerAddress: debuggingOptions.devToolsServerAddress,
), ),
......
...@@ -197,6 +197,7 @@ void main() { ...@@ -197,6 +197,7 @@ void main() {
restart: anyNamed('restart'), restart: anyNamed('restart'),
compileExpression: anyNamed('compileExpression'), compileExpression: anyNamed('compileExpression'),
getSkSLMethod: anyNamed('getSkSLMethod'), getSkSLMethod: anyNamed('getSkSLMethod'),
allowExistingDdsInstance: anyNamed('allowExistingDdsInstance'),
)).thenAnswer((Invocation invocation) async { }); )).thenAnswer((Invocation invocation) async { });
when(mockFlutterDevice.setupDevFS(any, any)) when(mockFlutterDevice.setupDevFS(any, any))
.thenAnswer((Invocation invocation) async { .thenAnswer((Invocation invocation) async {
...@@ -2815,7 +2816,7 @@ void main() { ...@@ -2815,7 +2816,7 @@ void main() {
observatoryUris: Stream<Uri>.value(testUri), observatoryUris: Stream<Uri>.value(testUri),
); );
await flutterDevice.connect(); await flutterDevice.connect(allowExistingDdsInstance: true);
verify(mockLogReader.connectedVMService = mockVMService); verify(mockLogReader.connectedVMService = mockVMService);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
VMServiceConnector: () => (Uri httpUri, { VMServiceConnector: () => (Uri httpUri, {
......
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