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

Side by Side Diff: runtime/observatory/tests/service/steal_breakpoint_test.dart

Issue 1150303004: Switch to using SourceLocation universally in service protocol. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: post merge Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « runtime/observatory/tests/service/source_location_test.dart ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --steal-b reakpoints 4 // VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --steal-b reakpoints
5 5
6 import 'package:observatory/service_io.dart'; 6 import 'package:observatory/service_io.dart';
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 import 'test_helper.dart'; 8 import 'test_helper.dart';
9 import 'dart:async'; 9 import 'dart:async';
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 await completer.future; // Wait for breakpoint event to fire. 46 await completer.future; // Wait for breakpoint event to fire.
47 }, 47 },
48 48
49 // We are at the breakpoint on line 14. 49 // We are at the breakpoint on line 14.
50 (Isolate isolate) async { 50 (Isolate isolate) async {
51 ServiceMap stack = await isolate.getStack(); 51 ServiceMap stack = await isolate.getStack();
52 expect(stack.type, equals('Stack')); 52 expect(stack.type, equals('Stack'));
53 expect(stack['frames'].length, greaterThanOrEqualTo(1)); 53 expect(stack['frames'].length, greaterThanOrEqualTo(1));
54 54
55 Script script = stack['frames'][0]['script']; 55 Script script = stack['frames'][0].location.script;
56 await script.load(); 56 await script.load();
57 expect(script.name,endsWith('steal_breakpoint_test.dart')); 57 expect(script.name,endsWith('steal_breakpoint_test.dart'));
58 expect(script.tokenToLine(stack['frames'][0]['tokenPos']), equals(14)); 58 expect(script.tokenToLine(stack['frames'][0].location.tokenPos), equals(14));
59 }, 59 },
60 60
61 // Resume 61 // Resume
62 (Isolate isolate) async { 62 (Isolate isolate) async {
63 Completer completer = new Completer(); 63 Completer completer = new Completer();
64 var subscription; 64 var subscription;
65 subscription = isolate.vm.events.stream.listen((ServiceEvent event) { 65 subscription = isolate.vm.events.stream.listen((ServiceEvent event) {
66 if (event.kind == ServiceEvent.kResume) { 66 if (event.kind == ServiceEvent.kResume) {
67 print('Isolate resumed'); 67 print('Isolate resumed');
68 subscription.cancel(); 68 subscription.cancel();
69 completer.complete(); 69 completer.complete();
70 } 70 }
71 }); 71 });
72 isolate.resume(); 72 isolate.resume();
73 await completer.future; 73 await completer.future;
74 }, 74 },
75 75
76 ]; 76 ];
77 77
78 main(args) => runIsolateTests(args, tests, testeeBefore: startTimer); 78 main(args) => runIsolateTests(args, tests, testeeBefore: startTimer);
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/source_location_test.dart ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698