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 {
final io.WebSocket channel = await _openChannel(wsUri.toString(), compression: compression);
final StreamController<dynamic> primary = 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) {
primary.add(data);
......@@ -357,15 +360,14 @@ class VMService implements vm_service.VmService {
}, onDone: () {
primary.close();
secondary.close();
if (!streamClosedCompleter.isCompleted) {
streamClosedCompleter.complete();
}
}, onError: (dynamic error, StackTrace stackTrace) {
primary.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(
primary.stream,
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