Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(982)

Unified Diff: runtime/observatory/tests/service/coverage_test.dart

Issue 1217823009: Make VM event streams look like real dart streams. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Polish Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/tests/service/coverage_test.dart
diff --git a/runtime/observatory/tests/service/coverage_test.dart b/runtime/observatory/tests/service/coverage_test.dart
index 45a60a8a9ac669ce80c9a6a290adabf91c00cc91..9f69984f834197f8dfd6e18d48e0cf62065ea7fb 100644
--- a/runtime/observatory/tests/service/coverage_test.dart
+++ b/runtime/observatory/tests/service/coverage_test.dart
@@ -57,11 +57,15 @@ var tests = [
return isolate.rootLibrary.load().then((_) {
// Set up a listener to wait for breakpoint events.
Completer completer = new Completer();
- isolate.vm.events.stream.listen((ServiceEvent event) {
- if (event.kind == ServiceEvent.kPauseBreakpoint) {
- print('Breakpoint reached');
- completer.complete();
- }
+ isolate.vm.getDebugEventStream().then((stream) {
+ var subscription;
+ subscription = stream.listen((ServiceEvent event) {
+ if (event.kind == ServiceEvent.kPauseBreakpoint) {
+ print('Breakpoint reached');
+ completer.complete();
+ subscription.cancel();
+ }
+ });
});
// Create a timer to set a breakpoint with a short delay.

Powered by Google App Engine
This is Rietveld 408576698