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

Unified Diff: runtime/observatory/tests/service/code_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/code_test.dart
diff --git a/runtime/observatory/tests/service/code_test.dart b/runtime/observatory/tests/service/code_test.dart
index 28e2f862f94c958c53285da8dfdf3390bff93350..4c5cdd35d7f2a86b6af63113589e271837f997e3 100644
--- a/runtime/observatory/tests/service/code_test.dart
+++ b/runtime/observatory/tests/service/code_test.dart
@@ -34,11 +34,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) {
Cutch 2015/07/07 23:16:09 Replace with: await isolate.addBreakpoint(script,
turnidge 2015/07/08 20:23:39 My preference is to modify the tests as little as
+ var subscription;
+ subscription = stream.listen((ServiceEvent event) {
+ if (event.kind == ServiceEvent.kPauseBreakpoint) {
+ print('Breakpoint reached');
+ subscription.cancel();
+ completer.complete();
+ }
+ });
});
// Add the breakpoint.

Powered by Google App Engine
This is Rietveld 408576698