@@ -458,14 +458,16 @@ class FlutterPlatform extends PlatformPlugin {
458
458
controllerSinkClosed = true ;
459
459
}));
460
460
461
- // When start paused is specified, it means that the user is likely
462
- // running this with a debugger attached. Initialize the resident
463
- // compiler in this case.
464
- if (debuggingOptions.startPaused) {
465
- compiler ?? = TestCompiler (debuggingOptions.buildInfo, flutterProject, precompiledDillPath: precompiledDillPath, testTimeRecorder: testTimeRecorder);
466
- final Uri testUri = globals.fs.file (testPath).uri;
467
- // Trigger a compilation to initialize the resident compiler.
468
- unawaited (compiler! .compile (testUri));
461
+ void initializeExpressionCompiler (String path) {
462
+ // When start paused is specified, it means that the user is likely
463
+ // running this with a debugger attached. Initialize the resident
464
+ // compiler in this case.
465
+ if (debuggingOptions.startPaused) {
466
+ compiler ?? = TestCompiler (debuggingOptions.buildInfo, flutterProject, precompiledDillPath: precompiledDillPath, testTimeRecorder: testTimeRecorder);
467
+ final Uri uri = globals.fs.file (path).uri;
468
+ // Trigger a compilation to initialize the resident compiler.
469
+ unawaited (compiler! .compile (uri));
470
+ }
469
471
}
470
472
471
473
// If a kernel file is given, then use that to launch the test.
@@ -474,6 +476,7 @@ class FlutterPlatform extends PlatformPlugin {
474
476
String ? mainDart;
475
477
if (precompiledDillPath != null ) {
476
478
mainDart = precompiledDillPath;
479
+ initializeExpressionCompiler (testPath);
477
480
} else if (precompiledDillFiles != null ) {
478
481
mainDart = precompiledDillFiles! [testPath];
479
482
} else {
@@ -489,6 +492,9 @@ class FlutterPlatform extends PlatformPlugin {
489
492
testHarnessChannel.sink.addError ('Compilation failed for testPath=$testPath ' );
490
493
return null ;
491
494
}
495
+ } else {
496
+ // For integration tests, we may still need to set up expression compilation service.
497
+ initializeExpressionCompiler (mainDart);
492
498
}
493
499
}
494
500
0 commit comments