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