OLD | NEW |
1 library IsolatesTest; | 1 library IsolatesTest; |
2 import '../../pkg/unittest/lib/unittest.dart'; | 2 import 'package:unittest/unittest.dart'; |
3 import '../../pkg/unittest/lib/html_config.dart'; | 3 import 'package:unittest/html_config.dart'; |
4 import 'dart:async'; | 4 import 'dart:async'; |
5 import 'dart:html'; | 5 import 'dart:html'; |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 import 'dart:isolate' as isolate; | 7 import 'dart:isolate' as isolate; |
8 | 8 |
9 String responseFor(message) => 'response for $message'; | 9 String responseFor(message) => 'response for $message'; |
10 | 10 |
11 void isolateEntry(isolate.SendPort initialReplyTo) { | 11 void isolateEntry(isolate.SendPort initialReplyTo) { |
12 var port = new isolate.ReceivePort(); | 12 var port = new isolate.ReceivePort(); |
13 initialReplyTo.send(port.sendPort); | 13 initialReplyTo.send(port.sendPort); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 sendReceive(port, msg1).then((response) { | 56 sendReceive(port, msg1).then((response) { |
57 expect(response, equals(responseFor(msg1))); | 57 expect(response, equals(responseFor(msg1))); |
58 sendReceive(port, msg2).then((response) { | 58 sendReceive(port, msg2).then((response) { |
59 expect(response, equals(responseFor(msg2))); | 59 expect(response, equals(responseFor(msg2))); |
60 callback(); | 60 callback(); |
61 }); | 61 }); |
62 }); | 62 }); |
63 }); | 63 }); |
64 }); | 64 }); |
65 } | 65 } |
OLD | NEW |