| 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'; | 10 import 'dart:isolate' as isolate; |
| 11 | 11 |
| 12 int counter = 0; | 12 int counter = 0; |
| 13 const stoppedAtLine = 23; | 13 const stoppedAtLine = 23; |
| 14 var port = new RawReceivePort(msgHandler); | 14 var port = new isolate.RawReceivePort(msgHandler); |
| 15 | 15 |
| 16 // This name is used in a test below. | 16 // This name is used in a test below. |
| 17 void msgHandler(_) { | 17 void msgHandler(_) { |
| 18 } | 18 } |
| 19 | 19 |
| 20 void periodicTask(_) { | 20 void periodicTask(_) { |
| 21 counter++; | 21 counter++; |
| 22 port.sendPort.send(34); | 22 port.sendPort.send(34); |
| 23 counter++; // Line 23. We set our breakpoint here. | 23 counter++; // Line 23. We set our breakpoint here. |
| 24 counter++; | 24 counter++; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 expect(msgHandlerObjectId, isNotNull); | 109 expect(msgHandlerObjectId, isNotNull); |
| 110 | 110 |
| 111 // Get object. | 111 // Get object. |
| 112 var object = await isolate.getObject(msgHandlerObjectId); | 112 var object = await isolate.getObject(msgHandlerObjectId); |
| 113 expect(object.valueAsString, equals('34')); | 113 expect(object.valueAsString, equals('34')); |
| 114 } | 114 } |
| 115 | 115 |
| 116 ]; | 116 ]; |
| 117 | 117 |
| 118 main(args) => runIsolateTests(args, tests, testeeBefore: startTimer); | 118 main(args) => runIsolateTests(args, tests, testeeBefore: startTimer); |
| OLD | NEW |