Unverified Commit cf5e4b54 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] fix routing test (#54313)

parent 412e4dd5
...@@ -350,6 +350,9 @@ class VMService implements vm_service.VmService { ...@@ -350,6 +350,9 @@ class VMService implements vm_service.VmService {
final io.WebSocket channel = await _openChannel(wsUri.toString(), compression: compression); final io.WebSocket channel = await _openChannel(wsUri.toString(), compression: compression);
final StreamController<dynamic> primary = StreamController<dynamic>(); final StreamController<dynamic> primary = StreamController<dynamic>();
final StreamController<dynamic> secondary = StreamController<dynamic>(); final StreamController<dynamic> secondary = StreamController<dynamic>();
// Create an instance of the package:vm_service API in addition to the flutter
// tool's to allow gradual migration.
final Completer<void> streamClosedCompleter = Completer<void>();
channel.listen((dynamic data) { channel.listen((dynamic data) {
primary.add(data); primary.add(data);
...@@ -357,15 +360,14 @@ class VMService implements vm_service.VmService { ...@@ -357,15 +360,14 @@ class VMService implements vm_service.VmService {
}, onDone: () { }, onDone: () {
primary.close(); primary.close();
secondary.close(); secondary.close();
if (!streamClosedCompleter.isCompleted) {
streamClosedCompleter.complete();
}
}, onError: (dynamic error, StackTrace stackTrace) { }, onError: (dynamic error, StackTrace stackTrace) {
primary.addError(error, stackTrace); primary.addError(error, stackTrace);
secondary.addError(error, stackTrace); secondary.addError(error, stackTrace);
}); });
// Create an instance of the package:vm_service API in addition to the flutter
// tool's to allow gradual migration.
final Completer<void> streamClosedCompleter = Completer<void>();
final vm_service.VmService delegateService = vm_service.VmService( final vm_service.VmService delegateService = vm_service.VmService(
primary.stream, primary.stream,
channel.add, channel.add,
......
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