diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/workers/non-automated | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/workers/non-automated')
11 files changed, 129 insertions, 0 deletions
diff --git a/testing/web-platform/tests/workers/non-automated/application-cache-dedicated.html b/testing/web-platform/tests/workers/non-automated/application-cache-dedicated.html new file mode 100644 index 000000000..704ecbcd7 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/application-cache-dedicated.html @@ -0,0 +1,21 @@ +<!doctype html> +<html manifest=cache.manifest> +<title>cache manifest</title> +<p>Script did not run.</p> +<p>To run this test again, delete private data and then load this test again.</p> +<script> +var p = document.querySelector('p'); +if (sessionStorage.testHasBeenLoadedBefore) { + var worker = new Worker('application-cache-dedicated.js'); + worker.onmessage = function(e) { + p.textContent = 'PASS'; + } + setTimeout(function(){ + if (p.textContent != 'PASS') + p.textContent = 'FAIL (got no message from worker)'; + }, 250); +} else { + sessionStorage.testHasBeenLoadedBefore = true; + p.textContent = 'Enable offline mode and then reload this test. It should say PASS.'; +} +</script> diff --git a/testing/web-platform/tests/workers/non-automated/application-cache-dedicated.js b/testing/web-platform/tests/workers/non-automated/application-cache-dedicated.js new file mode 100644 index 000000000..2318c2e26 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/application-cache-dedicated.js @@ -0,0 +1 @@ +postMessage(1);
\ No newline at end of file diff --git a/testing/web-platform/tests/workers/non-automated/cache.manifest b/testing/web-platform/tests/workers/non-automated/cache.manifest new file mode 100644 index 000000000..8d80e03b2 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/cache.manifest @@ -0,0 +1,3 @@ +CACHE MANIFEST +application-cache-dedicated.html +application-cache-dedicated.js diff --git a/testing/web-platform/tests/workers/non-automated/infinite-nested.html b/testing/web-platform/tests/workers/non-automated/infinite-nested.html new file mode 100644 index 000000000..3ff3edb35 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/infinite-nested.html @@ -0,0 +1,12 @@ +<!doctype html> +<title>infinite nested workers</title> +<p>There number below should be increasing (ideally never-ending).</p> +<div>0</div> +<script> +var worker = new Worker('infinite-nested.js'); +var div = document.getElementsByTagName('div')[0]; +var i = 0; +worker.onmessage = function(e) { + div.textContent = i++; +} +</script>
\ No newline at end of file diff --git a/testing/web-platform/tests/workers/non-automated/infinite-nested.js b/testing/web-platform/tests/workers/non-automated/infinite-nested.js new file mode 100644 index 000000000..137dd0a2e --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/infinite-nested.js @@ -0,0 +1,5 @@ +postMessage(1); +var w = new Worker('infinite-nested.js'); +w.onmessage = function(e) { + postMessage(e.data); +}
\ No newline at end of file diff --git a/testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.html b/testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.html new file mode 100644 index 000000000..463546cc9 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.html @@ -0,0 +1,12 @@ +<!doctype html> +<title>infinite sibling and nested workers</title> +<p>The number below should be increasing (ideally never-ending).</p> +<div>0</div> +<script> +var worker = new Worker('infinite-sibling-and-nested.js'); +var div = document.getElementsByTagName('div')[0]; +var i = 0; +worker.onmessage = function(e) { + div.textContent = i + e.data; +} +</script> diff --git a/testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.js b/testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.js new file mode 100644 index 000000000..cf7b794a4 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/infinite-sibling-and-nested.js @@ -0,0 +1,8 @@ +function createWorker() { + var worker = new Worker('infinite-nested.js?' + Math.random()); + worker.onmessage = function(e) { + postMessage(e.data); + createWorker(); + } +} +createWorker();
\ No newline at end of file diff --git a/testing/web-platform/tests/workers/non-automated/infinite-sibling.html b/testing/web-platform/tests/workers/non-automated/infinite-sibling.html new file mode 100644 index 000000000..edcb8d707 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/infinite-sibling.html @@ -0,0 +1,12 @@ +<!doctype html> +<title>infinite sibling workers</title> +<p>The number below should be increasing (ideally never-ending).</p> +<div>0</div> +<script> +var worker = new Worker('infinite-sibling.js'); +var div = document.getElementsByTagName('div')[0]; +var i = 0; +worker.onmessage = function(e) { + div.textContent = i + e.data; +} +</script> diff --git a/testing/web-platform/tests/workers/non-automated/infinite-sibling.js b/testing/web-platform/tests/workers/non-automated/infinite-sibling.js new file mode 100644 index 000000000..6424f7009 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/infinite-sibling.js @@ -0,0 +1,8 @@ +function createWorker() { + var worker = new Worker('post-a-1.js?' + Math.random()); + worker.onmessage = function(e) { + postMessage(e.data); + createWorker(); + } +} +createWorker();
\ No newline at end of file diff --git a/testing/web-platform/tests/workers/non-automated/navigator-onLine.html b/testing/web-platform/tests/workers/non-automated/navigator-onLine.html new file mode 100644 index 000000000..d71aeaf0a --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/navigator-onLine.html @@ -0,0 +1,46 @@ +<!-- +if ('onmessage' in self) { // dedicated worker + onmessage = function(e) { + postMessage(navigator.onLine); + } +} else { // shared worker + onconnect = function(e) { + e.ports[0].onmessage = function(e) { + this.postMessage(navigator.onLine); + } + } +} +/* +--> +<!doctype html> +<title>navigator.onLine in dedicated worker</title> +<pre>Log: +</pre> +<script> +var pre = document.querySelector('pre'); +var worker, shared; +try { worker = new Worker('#'); } catch(e) { pre.textContent += '\nnew Worker threw: ' + e.message; } +try { shared = new SharedWorker('#', ''); } catch(e) { pre.textContent += '\nnew SharedWorker threw: ' + e.message; } +if (worker) { + worker.onmessage = function(e) { + pre.textContent += '\ndedicated worker: ' + e.data; + } +} +if (shared) { + shared.port.onmessage = function(e) { + pre.textContent += '\nshared worker: ' + e.data; + } +} +function update() { + pre.textContent += '\n\n' + new Date() + '\n<script>: ' + navigator.onLine; + if (worker) worker.postMessage(1); + if (shared) shared.port.postMessage(1); +} +update(); +ononline = onoffline = update; +</script> +<p>As you go online and offline, the log should be filled with the correct status of navigator.onLine.</p> +<p><button onclick="update()">Check navigator.onLine status</button></p> +<!-- +*/ +//--> diff --git a/testing/web-platform/tests/workers/non-automated/post-a-1.js b/testing/web-platform/tests/workers/non-automated/post-a-1.js new file mode 100644 index 000000000..2318c2e26 --- /dev/null +++ b/testing/web-platform/tests/workers/non-automated/post-a-1.js @@ -0,0 +1 @@ +postMessage(1);
\ No newline at end of file |