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