Update web-platform-tests to revision ee40b886c701ffa25a673240cabdedd59ee3ace4

This commit is contained in:
Ms2ger 2015-11-24 12:29:19 +01:00
parent a00f2d6310
commit 3a79c9b53f
44 changed files with 631 additions and 75 deletions

View file

@ -0,0 +1,3 @@
<meta charset=utf-8>
<p>Follow this link to open a new browsing context and then confirm it can be closed:
<a rel=noreferrer target=reallydoesnotmatter href="//天気の良い日.{{location[host]}}/html/browsers/windows/support-close.html">link</a>.

View file

@ -0,0 +1,10 @@
<ol>
<li><p>After clicking these two links in order a single browsing context should be open showing
<code>example.org</code>:
<a target=doesnotmatter href="http://example.com/">one</a>,
<a target=doesnotmatter href="http://example.org/">two</a>.
<li><p>After clicking these two links two browsing contexts should have been opened:
<a rel=noreferrer target=reallydoesnotmatter href="http://example.com/">one</a>,
<a rel=noreferrer target=reallydoesnotmatter href="http://example.com/">two</a>.
</ol>

View file

@ -0,0 +1,3 @@
<meta charset=utf-8>
<p>Follow this link to open a new browsing context and then confirm it says "idonteven":
<a rel=noreferrer target=idonteven href="//天気の良い日.{{location[host]}}/html/browsers/windows/support-window-name-echo.html">link</a>.

View file

@ -0,0 +1,40 @@
<!doctype html>
<title>rel=noreferrer and reuse of names</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function(t) {
localStorage.clear()
function makeHyperlink(n) {
var hyperlink = document.body.appendChild(document.createElement("a"))
hyperlink.rel = "noreferrer"
hyperlink.target = "sufficientlyrandomwindownameamiright"
hyperlink.href = "support-named-null-opener.html#" + n
return hyperlink
}
var hyperlink1 = makeHyperlink(1),
hyperlink2 = makeHyperlink(2)
t.add_cleanup(function() {
localStorage.setItem("x", "close")
localStorage.clear()
document.body.removeChild(hyperlink1)
document.body.removeChild(hyperlink2)
})
addEventListener("storage", function(e) {
t.step(function() {
if(localStorage.getItem("window1") && localStorage.getItem("window2")) {
localStorage.setItem("x", "close")
t.done()
}
})
})
hyperlink1.click()
hyperlink2.click()
})
</script>

View file

@ -0,0 +1,25 @@
<!doctype html>
<title>rel=noreferrer nullifies window.opener</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function(t) {
localStorage.clear()
var hyperlink = document.body.appendChild(document.createElement("a"))
hyperlink.rel = "noreferrer"
hyperlink.target = "_blank"
hyperlink.href = "support-opener-null.html"
hyperlink.click()
document.body.removeChild(hyperlink)
addEventListener("storage", function(e) {
t.step(function() {
assert_equals(e.newValue, "null")
localStorage.clear()
t.done()
})
})
})
</script>

View file

@ -0,0 +1 @@
<p>Clicking this button should close this browsing context: <button onclick=window.close()>button</button>

View file

@ -0,0 +1,8 @@
<script>
addEventListener("storage", function(e) {
if(e.newValue === "close") {
close()
}
})
localStorage.setItem("window" + location.hash.slice(1), "tralala")
</script>

View file

@ -0,0 +1,12 @@
<body>
<script>
var i = document.createElement("iframe");
i.name = "nested1";
document.body.appendChild(i);
window.opener.postMessage({
"name": window.name,
"isTop": window.top === window
}, "*");
</script>
</body>

View file

@ -0,0 +1,4 @@
<script>
localStorage.setItem("opener", window.opener)
window.close()
</script>

View file

@ -0,0 +1,8 @@
<script>
if (window.opener) {
window.opener.postMessage({
"name": window.name,
"isTop": window.top === window
}, "*");
}
</script>

View file

@ -0,0 +1 @@
<script>document.write(name)</script>

View file

@ -0,0 +1,38 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Targeting nested browsing contexts</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
async_test(function (t) {
var windowsToClose = [];
window.onmessage = t.step_func(function (e) {
if (e.data.name == "openee") {
var a = document.body.appendChild(document.createElement('a'));
a.target = "nested1";
a.href = "support-post-to-opener.html";
a.click();
windowsToClose.push(e.source);
} else {
assert_equals(e.data.name, "nested1");
assert_equals(e.data.isTop, true);
windowsToClose.push(e.source);
windowsToClose.forEach(function (w) {
w.close();
});
t.done();
}
});
var a = document.body.appendChild(document.createElement('a'));
a.target = "openee";
a.href = "http://{{domains[www2]}}:{{location[port]}}/html/browsers/windows/support-nested-browsing-contexts.html";
a.click();
});
</script>
</body>
</html>