OLD | NEW |
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 | 4 |
5 import 'package:observatory/service_io.dart'; | 5 import 'package:observatory/service_io.dart'; |
6 import 'package:observatory/debugger.dart'; | 6 import 'package:observatory/debugger.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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 | 48 |
49 var tests = [ | 49 var tests = [ |
50 | 50 |
51 // Bring the isolate to a breakpoint at line 14. | 51 // Bring the isolate to a breakpoint at line 14. |
52 (Isolate isolate) { | 52 (Isolate isolate) { |
53 return isolate.rootLib.load().then((_) { | 53 return isolate.rootLib.load().then((_) { |
54 // Listen for breakpoint event. | 54 // Listen for breakpoint event. |
55 Completer completer = new Completer(); | 55 Completer completer = new Completer(); |
56 isolate.vm.events.stream.listen((ServiceEvent event) { | 56 isolate.vm.events.stream.listen((ServiceEvent event) { |
57 if (event.eventType == 'BreakpointReached') { | 57 if (event.eventType == ServiceEvent.kPauseBreakpoint) { |
58 completer.complete(); | 58 completer.complete(); |
59 } | 59 } |
60 }); | 60 }); |
61 | 61 |
62 // Add the breakpoint. | 62 // Add the breakpoint. |
63 var script = isolate.rootLib.scripts[0]; | 63 var script = isolate.rootLib.scripts[0]; |
64 return isolate.addBreakpoint(script, 14).then((ServiceObject bpt) { | 64 return isolate.addBreakpoint(script, 14).then((ServiceObject bpt) { |
65 return completer.future; // Wait for breakpoint events. | 65 return completer.future; // Wait for breakpoint events. |
66 }); | 66 }); |
67 }); | 67 }); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 return SourceLocation.complete(debugger, 'SourceLocationTestFoo.q') | 269 return SourceLocation.complete(debugger, 'SourceLocationTestFoo.q') |
270 .then((List<String> completions) { | 270 .then((List<String> completions) { |
271 expect(completions.toString(), equals('[]')); | 271 expect(completions.toString(), equals('[]')); |
272 }); | 272 }); |
273 }); | 273 }); |
274 }, | 274 }, |
275 | 275 |
276 ]; | 276 ]; |
277 | 277 |
278 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); | 278 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); |
OLD | NEW |