mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55: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,26 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: navigating top-level browsing context</title>
|
||||
<script src=../constants.js?pipe=sub></script>
|
||||
<script>
|
||||
var controller = opener || parent;
|
||||
var t = controller.t;
|
||||
var assert_equals = controller.asset_equals;
|
||||
var assert_unreached = controller.assert_unreached;
|
||||
var uuid = controller.uuid;
|
||||
t.add_cleanup(function() {delete sessionStorage[uuid];});
|
||||
t.step(function() {
|
||||
if (sessionStorage[uuid]) {
|
||||
t.done();
|
||||
} else {
|
||||
sessionStorage[uuid] = 'true';
|
||||
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/echo');
|
||||
ws.onopen = t.step_func(function(e) {
|
||||
setTimeout(t.step_func(function() {
|
||||
assert_unreached('document was not discarded');
|
||||
}), 1000);
|
||||
controller.navigate();
|
||||
})
|
||||
ws.onerror = ws.onmessage = ws.onclose = t.step_func(function(e) {assert_unreached("Got unexpected event " + e.type)});
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,23 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: navigating top-level browsing context</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=/common/utils.js></script>
|
||||
<script src=../constants.js?pipe=sub></script>
|
||||
<p>Test requires popup blocker disabled</p>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
var w;
|
||||
var uuid;
|
||||
t.step(function() {
|
||||
uuid = token()
|
||||
w = window.open("001-1.html");
|
||||
add_result_callback(function() {
|
||||
w.close();
|
||||
});
|
||||
});
|
||||
navigate = t.step_func(function() {
|
||||
w.location = 'data:text/html,<body onload="history.back()">';
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,32 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: navigating top-level browsing context with closed websocket</title>
|
||||
<script src=../constants.js?pipe=sub></script>
|
||||
<script>
|
||||
var controller = opener || parent;
|
||||
var t = controller.t;
|
||||
var assert_equals = controller.asset_equals;
|
||||
var assert_unreached = controller.assert_unreached ;
|
||||
var uuid = controller.token;
|
||||
t.add_cleanup(function() {delete sessionStorage[uuid];});
|
||||
t.step(function() {
|
||||
// this test can fail if the document is unloaded on navigation e.g. due to OOM
|
||||
if (sessionStorage[uuid]) {
|
||||
assert_unreached('document was discarded');
|
||||
} else {
|
||||
sessionStorage[uuid] = 'true';
|
||||
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/echo');
|
||||
ws.onopen = t.step_func(function(e) {
|
||||
|
||||
setTimeout(t.step_func(function() {
|
||||
assert_equals(ws.readyState, ws.CLOSED, 'ws.readyState');
|
||||
t.done();
|
||||
}), 4000);
|
||||
ws.close();
|
||||
ws.onclose = t.step_func(function() {
|
||||
controller.navigate();
|
||||
});
|
||||
})
|
||||
ws.onerror = ws.onmessage = ws.onclose = t.step_func(function(e) {assert_unreached("Got unexpected event " + e.type)});
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,24 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: navigating top-level browsing context with closed websocket</title>
|
||||
<meta name=timeout content=long>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=/common/utils.js></script>
|
||||
<script src=../constants.js?pipe=sub></script>
|
||||
<p>Test requires popup blocker disabled</p>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
var t = async_test(null, {timeout:15000});
|
||||
var w;
|
||||
var uuid;
|
||||
t.step(function() {
|
||||
uuid = token()
|
||||
w = window.open("002-1.html");
|
||||
add_result_callback(function() {
|
||||
w.close();
|
||||
});
|
||||
});
|
||||
navigate = t.step_func(function() {
|
||||
w.location = 'data:text/html,<body onload="history.back()">';
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,14 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: navigating nested browsing context</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=/common/utils.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
var uuid;
|
||||
var t = async_test(function() {uuid = token()});
|
||||
var navigate = t.step_func(function() {
|
||||
document.getElementsByTagName("iframe")[0].src = 'data:text/html,<body onload="history.back()">';
|
||||
});
|
||||
</script>
|
||||
<iframe src=001-1.html></iframe>
|
|
@ -0,0 +1,16 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: navigating nested browsing context with closed websocket</title>
|
||||
<meta name=timeout content=long>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=/common/utils.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
var uuid;
|
||||
var t = async_test(null, {timeout:15000})
|
||||
t.step(function() {uuid = token()});
|
||||
var navigate = t.step_func(function() {
|
||||
document.getElementsByTagName("iframe")[0].src = 'data:text/html,<body onload="history.back()">';
|
||||
});
|
||||
</script>
|
||||
<iframe src=002-1.html></iframe>
|
|
@ -0,0 +1,23 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: navigating nested browsing context with a websocket in top-level</title>
|
||||
<script src=../constants.js?pipe=sub></script>
|
||||
<script>
|
||||
var t = opener.t;
|
||||
var assert_unreached = opener.assert_unreached;
|
||||
var hasRun = false;
|
||||
function run(){
|
||||
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/echo');
|
||||
ws.onopen = t.step_func(function(e) {
|
||||
setTimeout(t.step_func(function() {
|
||||
ws.send('test');
|
||||
}), 1000);
|
||||
window[0].location = 'data:text/html,<body onload="history.back()">';
|
||||
ws.onmessage = t.step_func(function(e) {
|
||||
ws.close();
|
||||
t.done();
|
||||
});
|
||||
});
|
||||
ws.onerror = ws.onmessage = ws.onclose = t.step_func(function(e) {assert_unreached("Got unexpected event " + e.type)});
|
||||
}
|
||||
</script>
|
||||
<iframe src='data:text/html,foo' onload='if (hasRun) return; hasRun = true; t.step(run)'></iframe>
|
|
@ -0,0 +1,18 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: navigating nested browsing context with a websocket in top-level</title>
|
||||
<meta name=timeout content=long>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=../constants.js?pipe=sub></script>
|
||||
<div id=log></div>
|
||||
<p>Test requires popup blocker disabled</p>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
var t = async_test(null, {timeout:15000});
|
||||
t.step(function() {
|
||||
var w = window.open("005-1.html");
|
||||
add_result_callback(function() {
|
||||
w.close();
|
||||
});
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue