summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onmesage.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onmesage.js')
-rw-r--r--testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onmesage.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onmesage.js b/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onmesage.js
new file mode 100644
index 0000000000..9629f5e793
--- /dev/null
+++ b/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onmesage.js
@@ -0,0 +1,9 @@
+try {
+ var source = new EventSource("../resources/message.py")
+ source.onmessage = function(e) {
+ postMessage([true, e.data])
+ this.close()
+ }
+} catch(e) {
+ postMessage([false, String(e)])
+} \ No newline at end of file