Index: LayoutTests/dart/dom/Workers.dart |
diff --git a/LayoutTests/dart/dom/Workers.dart b/LayoutTests/dart/dom/Workers.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..be7d0026bdc7c5ad4c8d78eec8ee8cf2045da617 |
--- /dev/null |
+++ b/LayoutTests/dart/dom/Workers.dart |
@@ -0,0 +1,19 @@ |
+import 'package:expect/expect.dart'; |
+import 'package:unittest/html_config.dart'; |
+import 'package:unittest/unittest.dart'; |
+import 'dart:html'; |
+ |
+main() { |
+ useHtmlConfiguration(true); |
+ |
+ test('Workers minimal', () { |
+ // FIXME: once we decide how Workers and Dart go together, this may become pure |
+ // Dart test. |
+ final worker = new Worker('resources/pong.js'); |
+ worker.onError.listen((error) => Expect.fail('error: $error')); |
+ worker.onMessage.listen(expectAsync((event) { |
+ Expect.equals('I am fine, thank you.', event.data); |
+ })); |
+ worker.postMessage('How do you do?'); |
+ }); |
+} |