mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
|
@ -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>
|
|
@ -0,0 +1 @@
|
|||
postMessage(1);
|
|
@ -0,0 +1,3 @@
|
|||
CACHE MANIFEST
|
||||
application-cache-dedicated.html
|
||||
application-cache-dedicated.js
|
|
@ -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>
|
|
@ -0,0 +1,5 @@
|
|||
postMessage(1);
|
||||
var w = new Worker('infinite-nested.js');
|
||||
w.onmessage = function(e) {
|
||||
postMessage(e.data);
|
||||
}
|
|
@ -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>
|
|
@ -0,0 +1,8 @@
|
|||
function createWorker() {
|
||||
var worker = new Worker('infinite-nested.js?' + Math.random());
|
||||
worker.onmessage = function(e) {
|
||||
postMessage(e.data);
|
||||
createWorker();
|
||||
}
|
||||
}
|
||||
createWorker();
|
|
@ -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>
|
|
@ -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();
|
|
@ -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>
|
||||
<!--
|
||||
*/
|
||||
//-->
|
|
@ -0,0 +1 @@
|
|||
postMessage(1);
|
Loading…
Add table
Add a link
Reference in a new issue