[flutter_tools] add canvaskit hot reload integration test (#69550)

This commit is contained in:
Jonah Williams
2020-11-02 10:40:46 -08:00
committed by GitHub
parent 0490fd75aa
commit 8291f4810f
2 changed files with 22 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ void main() {
testWithoutContext('hot restart works without error', () async {
await flutter.run(chrome: true);
await flutter.hotRestart();
}, skip: platform.isMacOS);
}, skip: platform.isMacOS, retry: 1);
testWithoutContext('newly added code executes during hot restart', () async {
final Completer<void> completer = Completer<void>();
@@ -48,5 +48,23 @@ void main() {
} finally {
await subscription.cancel();
}
}, skip: platform.isMacOS);
}, skip: platform.isMacOS, retry: 1);
testWithoutContext('newly added code executes during hot restart - canvaskit', () async {
final Completer<void> completer = Completer<void>();
final StreamSubscription<String> subscription = flutter.stdout.listen((String line) {
print(line);
if (line.contains('(((((RELOAD WORKED)))))')) {
completer.complete();
}
});
await flutter.run(chrome: true, additionalCommandArgs: <String>['--dart-define=FLUTTER_WEB_USE_SKIA=true']);
project.uncommentHotReloadPrint();
try {
await flutter.hotRestart();
await completer.future;
} finally {
await subscription.cancel();
}
}, skip: true, retry: 1); // Currently broken: Expected a value of type 'Future<_RegisteredFont>', but got one of type '_Future<_RegisteredFont?>
}

View File

@@ -451,6 +451,7 @@ class FlutterRunTestDriver extends FlutterTestDriver {
bool singleWidgetReloads = false,
File pidFile,
String script,
List<String> additionalCommandArgs,
}) async {
await _setupProcess(
<String>[
@@ -471,6 +472,7 @@ class FlutterRunTestDriver extends FlutterTestDriver {
'flutter-tester',
if (structuredErrors)
'--dart-define=flutter.inspector.structuredErrors=true',
...?additionalCommandArgs,
],
withDebugger: withDebugger,
startPaused: startPaused,