| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 test; |
| 6 |
| 5 import 'dart:async'; | 7 import 'dart:async'; |
| 6 import 'dart:isolate'; | 8 import 'dart:isolate'; |
| 7 | 9 |
| 8 runTest() { | 10 runTest() { |
| 9 IsolateSink mainIsolate; | 11 IsolateSink mainIsolate; |
| 10 stream.listen((msg) { | 12 stream.listen((msg) { |
| 11 mainIsolate = msg; | 13 mainIsolate = msg; |
| 12 throw new RuntimeError("ignore exception"); | 14 throw new RuntimeError("ignore exception"); |
| 13 }, onDone: () { | 15 }, onDone: () { |
| 14 mainIsolate.add("received done"); | 16 mainIsolate.add("received done"); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 30 | 32 |
| 31 var box = new MessageBox(); | 33 var box = new MessageBox(); |
| 32 IsolateSink otherIsolate = streamSpawnFunction(runTest, globalErrorHandler); | 34 IsolateSink otherIsolate = streamSpawnFunction(runTest, globalErrorHandler); |
| 33 otherIsolate.add(box.sink); | 35 otherIsolate.add(box.sink); |
| 34 otherIsolate.close(); | 36 otherIsolate.close(); |
| 35 box.stream.single.then((msg) { | 37 box.stream.single.then((msg) { |
| 36 Expect.equals("received done", msg); | 38 Expect.equals("received done", msg); |
| 37 timer.cancel(); | 39 timer.cancel(); |
| 38 }); | 40 }); |
| 39 } | 41 } |
| OLD | NEW |