Unverified Commit 8291f481 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

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

parent 0490fd75
...@@ -30,7 +30,7 @@ void main() { ...@@ -30,7 +30,7 @@ void main() {
testWithoutContext('hot restart works without error', () async { testWithoutContext('hot restart works without error', () async {
await flutter.run(chrome: true); await flutter.run(chrome: true);
await flutter.hotRestart(); await flutter.hotRestart();
}, skip: platform.isMacOS); }, skip: platform.isMacOS, retry: 1);
testWithoutContext('newly added code executes during hot restart', () async { testWithoutContext('newly added code executes during hot restart', () async {
final Completer<void> completer = Completer<void>(); final Completer<void> completer = Completer<void>();
...@@ -48,5 +48,23 @@ void main() { ...@@ -48,5 +48,23 @@ void main() {
} finally { } finally {
await subscription.cancel(); 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?>
} }
...@@ -451,6 +451,7 @@ class FlutterRunTestDriver extends FlutterTestDriver { ...@@ -451,6 +451,7 @@ class FlutterRunTestDriver extends FlutterTestDriver {
bool singleWidgetReloads = false, bool singleWidgetReloads = false,
File pidFile, File pidFile,
String script, String script,
List<String> additionalCommandArgs,
}) async { }) async {
await _setupProcess( await _setupProcess(
<String>[ <String>[
...@@ -471,6 +472,7 @@ class FlutterRunTestDriver extends FlutterTestDriver { ...@@ -471,6 +472,7 @@ class FlutterRunTestDriver extends FlutterTestDriver {
'flutter-tester', 'flutter-tester',
if (structuredErrors) if (structuredErrors)
'--dart-define=flutter.inspector.structuredErrors=true', '--dart-define=flutter.inspector.structuredErrors=true',
...?additionalCommandArgs,
], ],
withDebugger: withDebugger, withDebugger: withDebugger,
startPaused: startPaused, startPaused: startPaused,
......
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