OLD | NEW |
1 library async_test; | 1 library async_test; |
2 | 2 |
3 import '../../pkg/unittest/lib/unittest.dart'; | 3 import 'package:unittest/unittest.dart'; |
4 import '../../pkg/unittest/lib/html_config.dart'; | 4 import 'package:unittest/html_config.dart'; |
5 | 5 |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'dart:isolate'; | 7 import 'dart:isolate'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 | 9 |
10 oneshotTimerIsolate(message) { | 10 oneshotTimerIsolate(message) { |
11 var command = message[0]; | 11 var command = message[0]; |
12 var replyTo = message[1]; | 12 var replyTo = message[1]; |
13 expect(command, 'START'); | 13 expect(command, 'START'); |
14 new Timer(const Duration(milliseconds: 10), () { | 14 new Timer(const Duration(milliseconds: 10), () { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 ['START', response.sendPort]); | 80 ['START', response.sendPort]); |
81 expect(remote.then((_) => response.first), completion('DONE')); | 81 expect(remote.then((_) => response.first), completion('DONE')); |
82 }); | 82 }); |
83 test('cancellation in pure isolate', () { | 83 test('cancellation in pure isolate', () { |
84 var response = new ReceivePort(); | 84 var response = new ReceivePort(); |
85 var remote = Isolate.spawn(cancellingIsolate, | 85 var remote = Isolate.spawn(cancellingIsolate, |
86 ['START', response.sendPort]); | 86 ['START', response.sendPort]); |
87 expect(remote.then((_) => response.first), completion('DONE')); | 87 expect(remote.then((_) => response.first), completion('DONE')); |
88 }); | 88 }); |
89 } | 89 } |
OLD | NEW |