Commit 18aed70e authored by Yegor Jbanov's avatar Yegor Jbanov

[driver] switch to different pause event workaround

parent db9a92e5
...@@ -50,15 +50,19 @@ class FlutterDriver { ...@@ -50,15 +50,19 @@ class FlutterDriver {
_log.trace('Looking for the isolate'); _log.trace('Looking for the isolate');
VMIsolate isolate = await vm.isolates.first.loadRunnable(); VMIsolate isolate = await vm.isolates.first.loadRunnable();
// TODO(yjbanov): for a very brief moment the isolate could report that it // TODO(yjbanov): vm_service_client does not support "None" pause event yet.
// is resumed, right before it goes into "paused on start" state. There's no // It is currently reported as `null`, but we cannot rely on it because
// robust way to deal with it other than waiting and querying for the // eventually the event will be reported as a non-`null` object. For now,
// isolate data again. 300 millis should be sufficient as the isolate is in // list all the events we know about. Later we'll check for "None" event
// the runnable state (i.e. it loaded and parsed all the Dart code) and // explicitly.
// going from here to the `main()` method should be trivial.
// //
// See: https://github.com/dart-lang/sdk/issues/25902 // See: https://github.com/dart-lang/vm_service_client/issues/4
if (isolate.pauseEvent is VMResumeEvent) { if (isolate.pauseEvent is! VMPauseStartEvent &&
isolate.pauseEvent is! VMPauseExitEvent &&
isolate.pauseEvent is! VMPauseBreakpointEvent &&
isolate.pauseEvent is! VMPauseExceptionEvent &&
isolate.pauseEvent is! VMPauseInterruptedEvent &&
isolate.pauseEvent is! VMResumeEvent) {
await new Future<Null>.delayed(new Duration(milliseconds: 300)); await new Future<Null>.delayed(new Duration(milliseconds: 300));
isolate = await vm.isolates.first.loadRunnable(); isolate = await vm.isolates.first.loadRunnable();
} }
......
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