Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,21 @@ void main() {

testWithoutContext('newly added code executes during hot reload', () async {
final StringBuffer stdout = StringBuffer();
final StreamSubscription<String> subscription = flutter.stdout.listen(stdout.writeln);
final Completer<void> completer = Completer<void>();
final StreamSubscription<String> subscription = flutter.stdout.listen((String e) {
stdout.writeln(e);
// If hot reload properly executes newly added code, the 'RELOAD WORKED' message should
// be printed before 'TICK 2'. If we don't wait for some signal that the build method
// has executed after the reload, this test can encounter a race.
if (e.contains('((((TICK 2))))')) {
completer.complete();
}
});
await flutter.run();
project.uncommentHotReloadPrint();
try {
await flutter.hotReload();
await completer.future;
expect(stdout.toString(), contains('(((((RELOAD WORKED)))))'));
} finally {
await subscription.cancel();
Expand Down