| OLD | NEW |
| 1 #import('../../../../../dart/pkg/unittest/lib/unittest.dart'); | 1 #import('../../../../../dart/pkg/unittest/lib/unittest.dart'); |
| 2 #import('../../../../../dart/pkg/unittest/lib/html_config.dart'); | 2 #import('../../../../../dart/pkg/unittest/lib/html_config.dart'); |
| 3 #import('dart:html'); | 3 #import('dart:html'); |
| 4 | 4 |
| 5 main() { | 5 main() { |
| 6 useHtmlConfiguration(true); | 6 useHtmlConfiguration(true); |
| 7 | 7 |
| 8 asyncTest('Workers minimal', 1, () { | 8 test('Workers minimal', () { |
| 9 // FIXME: once we decide how Workers and Dart go together, this may become p
ure | 9 // FIXME: once we decide how Workers and Dart go together, this may become p
ure |
| 10 // Dart test. | 10 // Dart test. |
| 11 final worker = new Worker('resources/pong.js'); | 11 final worker = new Worker('resources/pong.js'); |
| 12 worker.onError.listen((error) => Expect.fail('error: $error')); | 12 worker.onError.listen((error) => Expect.fail('error: $error')); |
| 13 worker.onMessage.listen((event) { | 13 worker.onMessage.listen(expectAsync1((event) { |
| 14 Expect.equals('I am fine, thank you.', event.data); | 14 Expect.equals('I am fine, thank you.', event.data); |
| 15 callbackDone(); | 15 })); |
| 16 }); | |
| 17 worker.postMessage('How do you do?'); | 16 worker.postMessage('How do you do?'); |
| 18 }); | 17 }); |
| 19 } | 18 } |
| OLD | NEW |