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

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

Issue 1116263004: Add 'dart:debugger' library (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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/lib/debugger_sources.gypi ('k') | runtime/vm/bootstrap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/get_stack_rpc_test.dart
diff --git a/runtime/observatory/tests/service/get_stack_rpc_test.dart b/runtime/observatory/tests/service/get_stack_rpc_test.dart
index e503527fce96813c0a01aeba53e0fa4b903b792c..a2bbc818448caced1a8621216012c79c20ae4217 100644
--- a/runtime/observatory/tests/service/get_stack_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_stack_rpc_test.dart
@@ -8,19 +8,18 @@ import 'package:unittest/unittest.dart';
import 'test_helper.dart';
import 'dart:async';
import 'dart:isolate' as isolate;
+import 'dart:debugger' as debugger;
int counter = 0;
const stoppedAtLine = 23;
var port = new isolate.RawReceivePort(msgHandler);
// This name is used in a test below.
-void msgHandler(_) {
-}
+void msgHandler(_) { }
void periodicTask(_) {
- counter++;
port.sendPort.send(34);
- counter++; // Line 23. We set our breakpoint here.
+ debugger.Debugger.breakHere(); // We will be at a breakpoint at the next line.
counter++;
if (counter % 300 == 0) {
print('counter = $counter');
@@ -33,34 +32,12 @@ void startTimer() {
var tests = [
-// Add breakpoint
+// Initial data fetch and verify we've hit the breakpoint.
(Isolate isolate) async {
await isolate.rootLib.load();
-
- // Set up a listener to wait for breakpoint events.
- Completer completer = new Completer();
- var subscription;
- subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
- if (event.eventType == ServiceEvent.kPauseBreakpoint) {
- print('Breakpoint reached');
- subscription.cancel();
- completer.complete();
- }
- });
-
var script = isolate.rootLib.scripts[0];
await script.load();
-
- // Add the breakpoint.
- var result = await isolate.addBreakpoint(script, stoppedAtLine);
- expect(result is Breakpoint, isTrue);
- Breakpoint bpt = result;
- expect(bpt.type, equals('Breakpoint'));
- expect(bpt.script.id, equals(script.id));
- expect(bpt.script.tokenToLine(bpt.tokenPos), equals(stoppedAtLine));
- expect(isolate.breakpoints.length, equals(1));
-
- await completer.future; // Wait for breakpoint events.
+ expect(isolate.pauseEvent.eventType, equals(ServiceEvent.kPauseBreakpoint));
},
// Get stack
« no previous file with comments | « runtime/lib/debugger_sources.gypi ('k') | runtime/vm/bootstrap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698