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 import 'dart:isolate' as isolate; | 10 import 'dart:isolate' as isolate; |
(...skipping 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 void startTimer() { | 29 void startTimer() { |
30 new Timer.periodic(const Duration(milliseconds:10), periodicTask); | 30 new Timer.periodic(const Duration(milliseconds:10), periodicTask); |
31 } | 31 } |
32 | 32 |
33 var tests = [ | 33 var tests = [ |
34 | 34 |
35 // Initial data fetch and verify we've hit the breakpoint. | 35 // Initial data fetch and verify we've hit the breakpoint. |
36 (Isolate isolate) async { | 36 (Isolate isolate) async { |
37 await isolate.rootLib.load(); | 37 await isolate.rootLibrary.load(); |
38 var script = isolate.rootLib.scripts[0]; | 38 var script = isolate.rootLibrary.scripts[0]; |
39 await script.load(); | 39 await script.load(); |
40 await hasStoppedAtBreakpoint(isolate); | 40 await hasStoppedAtBreakpoint(isolate); |
41 // Sanity check. | 41 // Sanity check. |
42 expect(isolate.pauseEvent.eventType, equals(ServiceEvent.kPauseBreakpoint)); | 42 expect(isolate.pauseEvent.eventType, equals(ServiceEvent.kPauseBreakpoint)); |
43 }, | 43 }, |
44 | 44 |
45 // Get stack | 45 // Get stack |
46 (Isolate isolate) async { | 46 (Isolate isolate) async { |
47 var stack = await isolate.getStack(); | 47 var stack = await isolate.getStack(); |
48 expect(stack.type, equals('Stack')); | 48 expect(stack.type, equals('Stack')); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 expect(msgHandlerObjectId, isNotNull); | 88 expect(msgHandlerObjectId, isNotNull); |
89 | 89 |
90 // Get object. | 90 // Get object. |
91 var object = await isolate.getObject(msgHandlerObjectId); | 91 var object = await isolate.getObject(msgHandlerObjectId); |
92 expect(object.valueAsString, equals('34')); | 92 expect(object.valueAsString, equals('34')); |
93 } | 93 } |
94 | 94 |
95 ]; | 95 ]; |
96 | 96 |
97 main(args) => runIsolateTests(args, tests, testeeBefore: startTimer); | 97 main(args) => runIsolateTests(args, tests, testeeBefore: startTimer); |
OLD | NEW |