| 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 @TestOn("vm") | 5 @TestOn("vm") |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:isolate'; | 8 import 'dart:isolate'; |
| 9 | 9 |
| 10 import 'package:test/src/backend/invoker.dart'; | 10 import 'package:test/src/backend/invoker.dart'; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 Isolate _isolate; | 26 Isolate _isolate; |
| 27 | 27 |
| 28 /// A live test that's running for the current test. | 28 /// A live test that's running for the current test. |
| 29 /// | 29 /// |
| 30 /// This is tracked so that it can be closed once the test is done. | 30 /// This is tracked so that it can be closed once the test is done. |
| 31 LiveTest _liveTest; | 31 LiveTest _liveTest; |
| 32 | 32 |
| 33 void main() { | 33 void main() { |
| 34 tearDown(() { | 34 tearDown(() { |
| 35 if (_isolate != null && supportsIsolateKill) { | 35 if (_isolate != null && supportsIsolateKill) { |
| 36 _isolate.kill(Isolate.IMMEDIATE); | 36 _isolate.kill(); |
| 37 } | 37 } |
| 38 _isolate = null; | 38 _isolate = null; |
| 39 | 39 |
| 40 if (_liveTest != null) _liveTest.close(); | 40 if (_liveTest != null) _liveTest.close(); |
| 41 _liveTest = null; | 41 _liveTest = null; |
| 42 }); | 42 }); |
| 43 | 43 |
| 44 test("sends a list of available tests on startup", () { | 44 test("sends a list of available tests on startup", () { |
| 45 return _spawnIsolate(_successfulTests).then((receivePort) { | 45 return _spawnIsolate(_successfulTests).then((receivePort) { |
| 46 return receivePort.first; | 46 return receivePort.first; |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 /// An isolate entrypoint that defines a test that prints twice. | 393 /// An isolate entrypoint that defines a test that prints twice. |
| 394 void _printTest(SendPort sendPort) { | 394 void _printTest(SendPort sendPort) { |
| 395 IsolateListener.start(sendPort, () => () { | 395 IsolateListener.start(sendPort, () => () { |
| 396 test("prints", () { | 396 test("prints", () { |
| 397 print("Hello,"); | 397 print("Hello,"); |
| 398 return new Future(() => print("world!")); | 398 return new Future(() => print("world!")); |
| 399 }); | 399 }); |
| 400 }); | 400 }); |
| 401 } | 401 } |
| 402 | 402 |
| OLD | NEW |