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

This commit is contained in:
Jonah Williams 2021-01-15 18:04:40 -08:00 committed by GitHub
parent e7aced17db
commit fc59f01ea8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View file

@ -222,7 +222,7 @@ class FlutterDevice {
int ddsPort,
bool disableServiceAuthCodes = false,
bool disableDds = false,
bool allowExistingDdsInstance = false,
@required bool allowExistingDdsInstance,
bool ipv6 = false,
}) {
final Completer<void> completer = Completer<void>();
@ -1217,7 +1217,7 @@ abstract class ResidentRunner {
Restart restart,
CompileExpression compileExpression,
GetSkSLMethod getSkSLMethod,
bool allowExistingDdsInstance,
@required bool allowExistingDdsInstance,
}) async {
if (!debuggingOptions.debuggingEnabled) {
throw 'The service protocol is not enabled.';

View file

@ -73,7 +73,9 @@ class ColdRunner extends ResidentRunner {
if (debuggingOptions.debuggingEnabled) {
try {
await Future.wait(<Future<void>>[
connectToServiceProtocol(),
connectToServiceProtocol(
allowExistingDdsInstance: false,
),
serveDevToolsGracefully(
devToolsServerAddress: debuggingOptions.devToolsServerAddress,
),

View file

@ -197,6 +197,7 @@ void main() {
restart: anyNamed('restart'),
compileExpression: anyNamed('compileExpression'),
getSkSLMethod: anyNamed('getSkSLMethod'),
allowExistingDdsInstance: anyNamed('allowExistingDdsInstance'),
)).thenAnswer((Invocation invocation) async { });
when(mockFlutterDevice.setupDevFS(any, any))
.thenAnswer((Invocation invocation) async {
@ -2815,7 +2816,7 @@ void main() {
observatoryUris: Stream<Uri>.value(testUri),
);
await flutterDevice.connect();
await flutterDevice.connect(allowExistingDdsInstance: true);
verify(mockLogReader.connectedVMService = mockVMService);
}, overrides: <Type, Generator>{
VMServiceConnector: () => (Uri httpUri, {