| 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 library dart.pkg.isolate.isolaterunner_test; | 5 library isolate.test.isolaterunner_test; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 import 'dart:isolate' show Capability; | 8 import 'dart:isolate' show Capability; |
| 9 | 9 |
| 10 import 'package:isolate/isolate_runner.dart'; | 10 import 'package:isolate/isolate_runner.dart'; |
| 11 import 'package:unittest/unittest.dart'; | 11 import 'package:unittest/unittest.dart'; |
| 12 | 12 |
| 13 const MS = const Duration(milliseconds: 1); | 13 const MS = const Duration(milliseconds: 1); |
| 14 | 14 |
| 15 void main() { | 15 void main() { |
| 16 test("create-close", testCreateClose); | 16 test("create-close", testCreateClose); |
| 17 test("create-run-close", testCreateRunClose); | 17 test("create-run-close", testCreateRunClose); |
| 18 test("separate-isolates", testSeparateIsolates); | 18 test("separate-isolates", testSeparateIsolates); |
| 19 testIsolateFunctions(); | 19 group('isolate functions', testIsolateFunctions); |
| 20 } | 20 } |
| 21 | 21 |
| 22 Future testCreateClose() { | 22 Future testCreateClose() { |
| 23 return IsolateRunner.spawn().then((IsolateRunner runner) { | 23 return IsolateRunner.spawn().then((IsolateRunner runner) { |
| 24 return runner.close(); | 24 return runner.close(); |
| 25 }); | 25 }); |
| 26 } | 26 } |
| 27 | 27 |
| 28 Future testCreateRunClose() { | 28 Future testCreateRunClose() { |
| 29 return IsolateRunner.spawn().then((IsolateRunner runner) { | 29 return IsolateRunner.spawn().then((IsolateRunner runner) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 return isolate.kill(); | 106 return isolate.kill(); |
| 107 }); | 107 }); |
| 108 }); | 108 }); |
| 109 } | 109 } |
| 110 | 110 |
| 111 id(x) => x; | 111 id(x) => x; |
| 112 | 112 |
| 113 var _global; | 113 var _global; |
| 114 getGlobal(_) => _global; | 114 getGlobal(_) => _global; |
| 115 setGlobal(v) => _global = v; | 115 setGlobal(v) => _global = v; |
| OLD | NEW |