Bug 1504776 - Fix a test that tries to navigate the test window, r=annevk

Differential Revision: https://phabricator.services.mozilla.com/D30375

--HG--
extra : moz-landing-system : lando
This commit is contained in:
James Graham 2019-05-09 13:53:37 +00:00
parent db1660661f
commit 24e220ca75
4 changed files with 17 additions and 14 deletions

View File

@ -0,0 +1,4 @@
<!DOCTYPE html>
<script>
window.location = "window-name-navigation.sub.html?hostname={{host}}&shouldhavename=true&sendmessage=true";
</script>

View File

@ -6,6 +6,6 @@
url.pathname = "/html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html";
url.search = "shouldhavename={{GET[shouldhavename]}}&sendmessage={{GET[sendmessage]}}";
window.name = "test";
document.location = url.href;
window.location = url.href;
</script>
</html>

View File

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<title>window.name after a same-origin main frame navigation</title>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
<body>
<script>
var win;
async_test(function(t) {
win = window.open("support/window-name-after-same-origin-main-frame-navigation-1.sub.html")
addEventListener("message", t.step_func_done(e => assert_true(e.data)));
}).add_cleanup(() => {if (win) {win.close()}});
</script>

View File

@ -1,13 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<!-- window.name should equal "test" after a same-origin main frame navigation. -->
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
</head>
<body>
<script>
document.location = "support/window-name-navigation.sub.html?hostname={{host}}&shouldhavename=true&sendmessage=false";
</script>
</body>
</html>