Update web-platform-tests to revision ee82278e15570e573d87fb80179ff8231b6db61a

This commit is contained in:
WPT Sync Bot 2018-06-03 21:07:04 -04:00
parent d23bc4f1a4
commit 83e2dc11b0
278 changed files with 13348 additions and 10515 deletions

View file

@ -10,25 +10,15 @@
<body>
<iframe sandbox="allow-top-navigation allow-scripts"></iframe>
<script>
if (opener) {
// We're the popup (i.e. a top frame). Load into the iframe the page
// trying to modifying the top frame and transmit the result to our
// opener.
onmessage = function(e) {
opener.postMessage(e.data, "*")
}
document.querySelector("iframe").src = "support/iframe-that-performs-top-navigation-on-popup.html";
} else {
// We are the main test page. Open ourselves as a popup, so that we can
// can experiment navigation of the top frame.
async_test(t => {
window.addEventListener("message", t.step_func_done(e => {
assert_equals(e.data, "can navigate");
e.source.close();
}));
window.open(location.href);
}, "Frames with `allow-top-navigation` should be able to navigate the top frame.");
}
// We are the main test page. Open a popup, so that we can
// can experiment navigation of the top frame.
async_test(t => {
window.addEventListener("message", t.step_func_done(e => {
assert_equals(e.data, "can navigate");
e.source.close();
}));
window.open("support/load-into-the-iframe.html");
}, "Frames with `allow-top-navigation` should be able to navigate the top frame.");
</script>
</body>
</html>

View file

@ -8,27 +8,16 @@
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<iframe sandbox="allow-scripts"></iframe>
<script>
if (opener) {
// We're the popup (i.e. a top frame). Load into the iframe the page
// trying to modifying the top frame and transmit the result to our
// opener.
onmessage = function(e) {
opener.postMessage(e.data, "*")
}
document.querySelector("iframe").src = "support/iframe-that-performs-top-navigation-on-popup.html";
} else {
// We are the main test page. Open ourselves as a popup, so that we can
// can experiment navigation of the top frame.
async_test(t => {
window.addEventListener("message", t.step_func_done(e => {
assert_equals(e.data, "cannot navigate");
e.source.close();
}));
window.open(location.href);
}, "Frames without `allow-top-navigation` should not be able to navigate the top frame.");
}
// We are the main test page. Open a popup, so that we can
// can experiment navigation of the top frame.
async_test(t => {
window.addEventListener("message", t.step_func_done(e => {
assert_equals(e.data, "cannot navigate");
e.source.close();
}));
window.open('support/load-into-the-iframe.html');
}, "Frames without `allow-top-navigation` should not be able to navigate the top frame.");
</script>
</body>
</html>

View file

@ -14,25 +14,15 @@
error: allow-top-navigation-by-user-activation will have no effect. -->
<iframe sandbox="allow-top-navigation allow-top-navigation-by-user-activation allow-scripts"></iframe>
<script>
if (opener) {
// We're the popup (i.e. a top frame). Load into the iframe the page
// trying to modifying the top frame and transmit the result to our
// opener.
onmessage = function(e) {
opener.postMessage(e.data, "*")
}
document.querySelector("iframe").src = "support/iframe-that-performs-top-navigation-on-popup.html";
} else {
// We are the main test page. Open ourselves as a popup, so that we can
// can experiment navigation of the top frame.
async_test(t => {
window.addEventListener("message", t.step_func_done(e => {
assert_equals(e.data, "can navigate");
e.source.close();
}));
window.open(location.href);
}, "Frames with `allow-top-navigation` should be able to navigate the top frame even when `allow-top-navigation-by-user-activation` is set.");
}
// We are the main test page. Open a popup, so that we can
// can experiment navigation of the top frame.
async_test(t => {
window.addEventListener("message", t.step_func_done(e => {
assert_equals(e.data, "can navigate");
e.source.close();
}));
window.open("support/load-into-the-iframe.html");
}, "Frames with `allow-top-navigation` should be able to navigate the top frame even when `allow-top-navigation-by-user-activation` is set.");
</script>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<iframe sandbox="allow-scripts"></iframe>
<script>
// We're the popup (i.e. a top frame). Load into the iframe the page
// trying to modifying the top frame and transmit the result to our
// opener.
onmessage = function(e) {
opener.postMessage(e.data, "*")
}
document.querySelector("iframe").src = "iframe-that-performs-top-navigation-on-popup.html";
</script>
</body>
</html>