Bug 1504776 - Fix a test that tries to navigate the test window, r=annevk
authorJames Graham <james@hoppipolla.co.uk>
Thu, 09 May 2019 13:53:37 +0000
changeset 535097 31ed335e3d2ca3a22ff4ebbd2ad21be1682cd28d
parent 535096 38ce182f68ea52e21cf4a73ab857d12bd95d1616
child 535098 a11a1329e0d60e056c2562a06a50253bf90e54b8
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersannevk
bugs1504776
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1504776 - Fix a test that tries to navigate the test window, r=annevk Differential Revision: https://phabricator.services.mozilla.com/D30375
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-same-origin-main-frame-navigation-1.sub.html
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-navigation.sub.html
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-same-origin-main-frame-navigation.html
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-same-origin-main-frame-navigation.sub.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-same-origin-main-frame-navigation-1.sub.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<script>
+  window.location = "window-name-navigation.sub.html?hostname={{host}}&shouldhavename=true&sendmessage=true";
+</script>
--- a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-navigation.sub.html
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-navigation.sub.html
@@ -1,11 +1,11 @@
 <!DOCTYPE html>
 <html>
     <script>
         var url = new URL(window.location.href);
         url.hostname = "{{GET[hostname]}}";
         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>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-same-origin-main-frame-navigation.html
@@ -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>
deleted file mode 100644
--- a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-same-origin-main-frame-navigation.sub.html
+++ /dev/null
@@ -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>