| 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 19 matching lines...) Expand all Loading... |
| 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.rootLib.load(); |
| 38 var script = isolate.rootLib.scripts[0]; | 38 var script = isolate.rootLib.scripts[0]; |
| 39 await script.load(); | 39 await script.load(); |
| 40 await hasStoppedAtBreakpoint(isolate); |
| 41 // Sanity check. |
| 40 expect(isolate.pauseEvent.eventType, equals(ServiceEvent.kPauseBreakpoint)); | 42 expect(isolate.pauseEvent.eventType, equals(ServiceEvent.kPauseBreakpoint)); |
| 41 }, | 43 }, |
| 42 | 44 |
| 43 // Get stack | 45 // Get stack |
| 44 (Isolate isolate) async { | 46 (Isolate isolate) async { |
| 45 var stack = await isolate.getStack(); | 47 var stack = await isolate.getStack(); |
| 46 expect(stack.type, equals('Stack')); | 48 expect(stack.type, equals('Stack')); |
| 47 | 49 |
| 48 // Sanity check. | 50 // Sanity check. |
| 49 expect(stack['frames'].length, greaterThanOrEqualTo(1)); | 51 expect(stack['frames'].length, greaterThanOrEqualTo(1)); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 expect(msgHandlerObjectId, isNotNull); | 88 expect(msgHandlerObjectId, isNotNull); |
| 87 | 89 |
| 88 // Get object. | 90 // Get object. |
| 89 var object = await isolate.getObject(msgHandlerObjectId); | 91 var object = await isolate.getObject(msgHandlerObjectId); |
| 90 expect(object.valueAsString, equals('34')); | 92 expect(object.valueAsString, equals('34')); |
| 91 } | 93 } |
| 92 | 94 |
| 93 ]; | 95 ]; |
| 94 | 96 |
| 95 main(args) => runIsolateTests(args, tests, testeeBefore: startTimer); | 97 main(args) => runIsolateTests(args, tests, testeeBefore: startTimer); |
| OLD | NEW |