summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/eventsource/dedicated-worker
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/eventsource/dedicated-worker')
-rw-r--r--testing/web-platform/tests/eventsource/dedicated-worker/eventsource-close.htm36
-rw-r--r--testing/web-platform/tests/eventsource/dedicated-worker/eventsource-constructor-non-same-origin.htm49
-rw-r--r--testing/web-platform/tests/eventsource/dedicated-worker/eventsource-constructor-url-bogus.htm34
-rw-r--r--testing/web-platform/tests/eventsource/dedicated-worker/eventsource-eventtarget.worker.js11
-rw-r--r--testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onmesage.htm36
-rw-r--r--testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onopen.htm39
-rw-r--r--testing/web-platform/tests/eventsource/dedicated-worker/eventsource-prototype.htm36
-rw-r--r--testing/web-platform/tests/eventsource/dedicated-worker/eventsource-url.htm35
8 files changed, 0 insertions, 276 deletions
diff --git a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-close.htm b/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-close.htm
deleted file mode 100644
index 42ebb1da8..000000000
--- a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-close.htm
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--
-try {
- var source = new EventSource("../resources/message.py")
- source.onopen = function(e) {
- this.close()
- postMessage([true, this.readyState])
- }
-} catch(e) {
- postMessage([false, String(e)])
-}
-/*-->
-<!DOCTYPE html>
-<html>
- <head>
- <title>dedicated worker - EventSource: close()</title>
- <script src="/resources/testharness.js"></script>
- <script src="/resources/testharnessreport.js"></script>
- </head>
- <body>
- <div id="log"></div>
- <script>
- var test = async_test();
- test.step(function() {
- var worker = new Worker('#')
- worker.onmessage = function(e) {
- test.step(function() {
- assert_true(e.data[0], e.data[1])
- assert_equals(e.data[1], EventSource.CLOSED, 'this.readyState')
- })
- test.done()
- }
- })
- </script>
- </body>
-</html>
-<!--*/ //-->
diff --git a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-constructor-non-same-origin.htm b/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-constructor-non-same-origin.htm
deleted file mode 100644
index 9fe515d2a..000000000
--- a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-constructor-non-same-origin.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<!--
-try {
- var url = decodeURIComponent(location.hash.substr(1))
- var source = new EventSource(url)
- source.onerror = function(e) {
- postMessage([true, this.readyState, 'data' in e])
- this.close();
- }
-} catch(e) {
- postMessage([false, String(e)])
-}
-/*-->
-<!DOCTYPE html>
-<html>
- <head>
- <title>dedicated worker - EventSource: constructor (act as if there is a network error)</title>
- <meta name=timeout content=long>
- <script src="/resources/testharness.js"></script>
- <script src="/resources/testharnessreport.js"></script>
- </head>
- <body>
- <div id="log"></div>
- <script>
- function fetchFail(url) {
- var test = async_test(document.title + " (" + url + ")", { timeout: 20000 })
- test.step(function() {
- var worker = new Worker('#'+encodeURIComponent(url))
- worker.onmessage = function(e) {
- test.step(function() {
- assert_true(e.data[0], e.data[1])
- assert_equals(e.data[1], EventSource.CLOSED, 'source.readyState')
- assert_false(e.data[2], "'data' in e");
- })
- test.done()
- }
- })
- }
- fetchFail("http://example.not/")
- fetchFail("https://example.not/test")
- fetchFail("ftp://example.not/")
- fetchFail("about:blank")
- fetchFail("mailto:whatwg@awesome.example")
- fetchFail("javascript:alert('FAIL')")
- </script>
- <!-- This tests "fails the connection" as well as making sure a simple
- event is dispatched and not a MessageEvent -->
- </body>
-</html>
-<!--*/ //-->
diff --git a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-constructor-url-bogus.htm b/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-constructor-url-bogus.htm
deleted file mode 100644
index 5ffdec81f..000000000
--- a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-constructor-url-bogus.htm
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
-try {
- var source = new EventSource("http://this is invalid/")
- postMessage([false, 'no exception thrown'])
- source.close()
-} catch(e) {
- postMessage([true, e.code])
-}
-/*-->
-<!DOCTYPE html>
-<html>
- <head>
- <title>dedicated worker - EventSource: constructor (invalid URL)</title>
- <script src="/resources/testharness.js"></script>
- <script src="/resources/testharnessreport.js"></script>
- </head>
- <body>
- <div id="log"></div>
- <script>
- var test = async_test()
- test.step(function() {
- var worker = new Worker('#')
- worker.onmessage = function(e) {
- test.step(function() {
- assert_true(e.data[0], e.data[1])
- assert_equals(e.data[1], DOMException.SYNTAX_ERR, 'e.code')
- })
- test.done()
- }
- })
- </script>
- </body>
-</html>
-<!--*/ //--> \ No newline at end of file
diff --git a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-eventtarget.worker.js b/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-eventtarget.worker.js
deleted file mode 100644
index 73b30556c..000000000
--- a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-eventtarget.worker.js
+++ /dev/null
@@ -1,11 +0,0 @@
-importScripts("/resources/testharness.js");
-
-async_test(function() {
- var source = new EventSource("../resources/message.py")
- source.addEventListener("message", this.step_func_done(function(e) {
- assert_equals(e.data, 'data');
- source.close();
- }), false)
-}, "dedicated worker - EventSource: addEventListener()");
-
-done();
diff --git a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onmesage.htm b/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onmesage.htm
deleted file mode 100644
index 2de142ca5..000000000
--- a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onmesage.htm
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--
-try {
- var source = new EventSource("../resources/message.py")
- source.onmessage = function(e) {
- postMessage([true, e.data])
- this.close()
- }
-} catch(e) {
- postMessage([false, String(e)])
-}
-/*-->
-<!DOCTYPE html>
-<html>
- <head>
- <title>dedicated worker - EventSource: onmessage</title>
- <script src="/resources/testharness.js"></script>
- <script src="/resources/testharnessreport.js"></script>
- </head>
- <body>
- <div id="log"></div>
- <script>
- var test = async_test()
- test.step(function() {
- var worker = new Worker('#')
- worker.onmessage = function(e) {
- test.step(function() {
- assert_true(e.data[0], e.data[1])
- assert_equals(e.data[1], "data", 'e.data')
- })
- test.done()
- }
- })
- </script>
- </body>
-</html>
-<!--*/ //-->
diff --git a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onopen.htm b/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onopen.htm
deleted file mode 100644
index e753b42f7..000000000
--- a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-onopen.htm
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
-try {
- var source = new EventSource("../resources/message.py")
- source.onopen = function(e) {
- postMessage([true, source.readyState, 'data' in e, e.bubbles, e.cancelable])
- this.close()
- }
-} catch(e) {
- postMessage([false, String(e)])
-}
-/*-->
-<!DOCTYPE html>
-<html>
- <head>
- <title>dedicated worker - EventSource: onopen (announcing the connection)</title>
- <script src="/resources/testharness.js"></script>
- <script src="/resources/testharnessreport.js"></script>
- </head>
- <body>
- <div id="log"></div>
- <script>
- var test = async_test()
- test.step(function() {
- var worker = new Worker('#')
- worker.onmessage = function(e) {
- test.step(function() {
- assert_true(e.data[0], e.data[1])
- assert_equals(e.data[1], EventSource.OPEN, 'source.readyState')
- assert_false(e.data[2], "'data' in e")
- assert_false(e.data[3], 'e.bubbles')
- assert_false(e.data[4], 'e.calcelable')
- })
- test.done()
- }
- })
- </script>
- </body>
-</html>
-<!--*/ //-->
diff --git a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-prototype.htm b/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-prototype.htm
deleted file mode 100644
index b16e24c86..000000000
--- a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-prototype.htm
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--
-try {
- EventSource.prototype.ReturnTrue = function() { return true }
- var source = new EventSource("../resources/message.py")
- postMessage([true, source.ReturnTrue(), 'EventSource' in self])
- source.close()
-} catch(e) {
- postMessage([false, String(e)])
-}
-/*-->
-<!DoCtYpE hTMl>
-<html>
- <heAd>
- <title>dedicated worker - EventSource: prototype et al</tiTle>
- <scrIpt src="/resources/testharness.js"></scripT>
- <scriPt src="/resources/testharnessreport.js"></Script>
- </heaD>
- <boDy>
- <diV iD="log"></Div>
- <sCript>
- var test = async_test();
- test.step(function() {
- var worker = new Worker('#')
- worker.onmessage = function(e) {
- test.step(function() {
- assert_true(e.data[0], e.data[1])
- assert_true(e.data[1], 'source.ReturnTrue()')
- assert_true(e.data[2], "'EventSource' in self")
- })
- test.done()
- }
- })
- </scrIpt>
- </bOdy>
-</htMl>
-<!--*/ //-->
diff --git a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-url.htm b/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-url.htm
deleted file mode 100644
index c1ed07827..000000000
--- a/testing/web-platform/tests/eventsource/dedicated-worker/eventsource-url.htm
+++ /dev/null
@@ -1,35 +0,0 @@
-<!--
-try {
- var source = new EventSource("../resources/message.py")
- postMessage([true, source.url])
- source.close()
-} catch(e) {
- postMessage([false, String(e)])
-}
-/*-->
-<!DOCTYPE html>
-<html>
- <head>
- <title>dedicated worker - EventSource: url</title>
- <script src="/resources/testharness.js"></script>
- <script src="/resources/testharnessreport.js"></script>
- </head>
- <body>
- <div id="log"></div>
- <script>
- var test = async_test();
- test.step(function() {
- var url = "resources/message.py"
- var worker = new Worker('#')
- worker.onmessage = function(e) {
- test.step(function() {
- assert_true(e.data[0], e.data[1]);
- assert_equals(e.data[1].substr(-(url.length)), url)
- })
- test.done()
- }
- })
- </script>
- </body>
-</html>
-<!--*/ //-->