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

Unified Diff: runtime/observatory/test/debugging_test.dart

Issue 979823003: Major rework of vm service events. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
« no previous file with comments | « runtime/observatory/test/coverage_test.dart ('k') | runtime/observatory/test/eval_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/test/debugging_test.dart
diff --git a/runtime/observatory/test/debugging_test.dart b/runtime/observatory/test/debugging_test.dart
index 51204e7dbab7c4f10b69a88dfb75beb443ce6d2d..aecb7cc35425db8bea17b4b814546f8052b217b2 100644
--- a/runtime/observatory/test/debugging_test.dart
+++ b/runtime/observatory/test/debugging_test.dart
@@ -26,7 +26,7 @@ var tests = [
(Isolate isolate) {
Completer completer = new Completer();
isolate.vm.events.stream.listen((ServiceEvent event) {
- if (event.eventType == 'IsolateInterrupted') {
+ if (event.eventType == ServiceEvent.kPauseInterrupted) {
completer.complete();
}
});
@@ -37,7 +37,9 @@ var tests = [
// Resume
(Isolate isolate) {
return isolate.resume().then((_) {
- expect(isolate.pauseEvent == null, isTrue);
+ expect(isolate.pauseEvent.eventType, equals(ServiceEvent.kResume));
+ expect(isolate.running, isTrue);
+ expect(isolate.paused, isFalse);
});
},
@@ -49,15 +51,10 @@ var tests = [
List events = [];
var subscription;
subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
- if (event.eventType.startsWith('Breakpoint')) {
- events.add(event);
- if (events.length == 2) {
- expect(events[0].eventType, equals('BreakpointResolved'));
- expect(events[1].eventType, equals('BreakpointReached'));
- print('Breakpoint reached');
- subscription.cancel();
- completer.complete();
- }
+ if (event.eventType == ServiceEvent.kPauseBreakpoint) {
+ print('Breakpoint reached');
+ subscription.cancel();
+ completer.complete();
}
});
@@ -91,7 +88,7 @@ var tests = [
List events = [];
var subscription;
subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
- if (event.eventType.startsWith('BreakpointReached')) {
+ if (event.eventType == ServiceEvent.kPauseBreakpoint) {
print('Breakpoint reached');
subscription.cancel();
completer.complete();
@@ -114,17 +111,32 @@ var tests = [
// Remove breakpoint
(Isolate isolate) {
+ // Set up a listener to wait for breakpoint events.
+ Completer completer = new Completer();
+ List events = [];
+ var subscription;
+ subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
+ if (event.eventType == ServiceEvent.kBreakpointRemoved) {
+ print('Breakpoint removed');
+ expect(isolate.breakpoints.length, equals(0));
+ subscription.cancel();
+ completer.complete();
+ }
+ });
+
expect(isolate.breakpoints.length, equals(1));
- var bpt = isolate.breakpoints[0];
+ var bpt = isolate.breakpoints.values.first;
return isolate.removeBreakpoint(bpt).then((_) {
- expect(isolate.breakpoints.length, equals(0));
+ return completer.future;
});
},
// Resume
(Isolate isolate) {
return isolate.resume().then((_) {
- expect(isolate.pauseEvent == null, isTrue);
+ expect(isolate.pauseEvent.eventType, equals(ServiceEvent.kResume));
+ expect(isolate.running, isTrue);
+ expect(isolate.paused, isFalse);
});
},
@@ -135,7 +147,7 @@ var tests = [
List events = [];
var subscription;
subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
- if (event.eventType.startsWith('BreakpointReached')) {
+ if (event.eventType == ServiceEvent.kPauseBreakpoint) {
print('Breakpoint reached');
subscription.cancel();
completer.complete();
« no previous file with comments | « runtime/observatory/test/coverage_test.dart ('k') | runtime/observatory/test/eval_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698