Update web-platform-tests to revision d3cf77a7b8c20c678b725238eaa8a72eca3787ae

This commit is contained in:
WPT Sync Bot 2019-04-25 22:18:37 -04:00
parent 880f3b8b7a
commit efca990ffe
541 changed files with 8000 additions and 2276 deletions

View file

@ -0,0 +1,26 @@
<!doctype html>
<meta charset=utf-8>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src="/common/get-host-info.sub.js"></script>
<script>
const CHANNEL_NAME = "new_window_same_site";
async_test(t => {
let w = window.open(`${get_host_info().HTTP_REMOTE_ORIGIN}/html/cross-origin-opener/resources/window.sub.html?channel=${CHANNEL_NAME}`, "window_name", "height=200,width=250");
// w will be closed by its postback iframe. When out of process,
// window.close() does not work.
t.add_cleanup(() => w.close());
let bc = new BroadcastChannel(CHANNEL_NAME);
bc.onmessage = t.step_func_done((event) => {
let payload = event.data;
assert_equals(payload.name, "window_name");
assert_equals(payload.opener, true);
});
}, "same-site policy works");
</script>

View file

@ -0,0 +1 @@
Cross-Origin-Opener-Policy: same-site

View file

@ -0,0 +1,13 @@
<!doctype html>
<meta charset=utf-8>
<script>
let channelName = new URL(location).searchParams.get("channel");
let bc = new BroadcastChannel(channelName);
window.addEventListener("message", (event) => {
bc.postMessage(event.data);
window.parent.close();
}, false);
</script>

View file

@ -0,0 +1,18 @@
<!doctype html>
<meta charset=utf-8>
<script src="/common/get-host-info.sub.js"></script>
<div id="status"> </div>
<script type="text/javascript">
let iframe = document.createElement("iframe");
iframe.onload = () => {
let payload = { name: self.name, opener: !!self.opener };
iframe.contentWindow.postMessage(payload, "*");
};
let channelName = new URL(location).searchParams.get("channel");
iframe.src = `${get_host_info().HTTP_ORIGIN}/html/cross-origin-opener/resources/postback.sub.html?channel=${channelName}`;
document.body.appendChild(iframe);
</script>

View file

@ -0,0 +1 @@
Cross-Origin-Opener-Policy: same-site