OLD | NEW |
1 #library('IsolatesTest'); | 1 #library('IsolatesTest'); |
2 #import('../../../testing/unittest/unittest.dart'); | 2 #import('../../../testing/unittest/unittest.dart'); |
3 #import('dart:dom'); | 3 #import('dart:dom'); |
4 #import('dart:json'); | 4 #import('dart:json'); |
| 5 #import('dart:isolate'); |
5 | 6 |
6 class PingPongIsolate extends Isolate { | 7 class PingPongIsolate extends Isolate { |
7 PingPongIsolate() : super.heavy(); | 8 PingPongIsolate() : super.heavy(); |
8 | 9 |
9 void main() { | 10 void main() { |
10 bool wasThrown = false; | 11 bool wasThrown = false; |
11 try { | 12 try { |
12 window.alert('Test'); | 13 window.alert('Test'); |
13 } catch(final e) { | 14 } catch(final e) { |
14 wasThrown = true; | 15 wasThrown = true; |
(...skipping 28 matching lines...) Expand all Loading... |
43 port.call(msg1).receive((response, _) { | 44 port.call(msg1).receive((response, _) { |
44 Expect.equals(PingPongIsolate.responseFor(msg1), response); | 45 Expect.equals(PingPongIsolate.responseFor(msg1), response); |
45 port.call(msg2).receive((response, _) { | 46 port.call(msg2).receive((response, _) { |
46 Expect.equals(PingPongIsolate.responseFor(msg2), response); | 47 Expect.equals(PingPongIsolate.responseFor(msg2), response); |
47 callbackDone(); | 48 callbackDone(); |
48 }); | 49 }); |
49 }); | 50 }); |
50 }); | 51 }); |
51 }); | 52 }); |
52 } | 53 } |
OLD | NEW |