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 // VMOptions=--compile-all --error_on_bad_type --error_on_bad_override | 4 // VMOptions=--compile-all --error_on_bad_type --error_on_bad_override |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 return normalized; | 50 return normalized; |
51 } | 51 } |
52 | 52 |
53 var tests = [ | 53 var tests = [ |
54 | 54 |
55 // Go to breakpoint at line 14. | 55 // Go to breakpoint at line 14. |
56 (Isolate isolate) { | 56 (Isolate isolate) { |
57 return isolate.rootLibrary.load().then((_) { | 57 return isolate.rootLibrary.load().then((_) { |
58 // Set up a listener to wait for breakpoint events. | 58 // Set up a listener to wait for breakpoint events. |
59 Completer completer = new Completer(); | 59 Completer completer = new Completer(); |
60 isolate.vm.events.stream.listen((ServiceEvent event) { | 60 isolate.vm.debugEvents.listen((ServiceEvent event) { |
61 if (event.eventType == ServiceEvent.kPauseBreakpoint) { | 61 if (event.eventType == ServiceEvent.kPauseBreakpoint) { |
62 print('Breakpoint reached'); | 62 print('Breakpoint reached'); |
63 completer.complete(); | 63 completer.complete(); |
64 } | 64 } |
65 }); | 65 }); |
66 | 66 |
67 // Create a timer to set a breakpoint with a short delay. | 67 // Create a timer to set a breakpoint with a short delay. |
68 new Timer(new Duration(milliseconds: 2000), () { | 68 new Timer(new Duration(milliseconds: 2000), () { |
69 // Add the breakpoint. | 69 // Add the breakpoint. |
70 print('Setting breakpoint.'); | 70 print('Setting breakpoint.'); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 expect(coverage['coverage'].length, greaterThan(100)); | 146 expect(coverage['coverage'].length, greaterThan(100)); |
147 }); | 147 }); |
148 })); | 148 })); |
149 return Future.wait(tests); | 149 return Future.wait(tests); |
150 }); | 150 }); |
151 }, | 151 }, |
152 | 152 |
153 ]; | 153 ]; |
154 | 154 |
155 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); | 155 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); |
OLD | NEW |