Bug 1466104 [wpt PR 11296] - HTML: Run a history navigation test in a popup to report a result, a=testonly
authorSimon Pieters <zcorpan@gmail.com>
Fri, 06 Jul 2018 13:44:15 +0000
changeset 425811 9691d06c2dda23e88cf827103350c015fc21af7f
parent 425810 635039532943fae130ea0a356b0bc79b67e61ad4
child 425812 a7f34c778e53a38a4391431d7eaf6fb94b21cd5d
push id34267
push userrgurzau@mozilla.com
push dateWed, 11 Jul 2018 22:05:21 +0000
treeherdermozilla-central@3aca103e4915 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1466104, 11296, 11269
milestone63.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 1466104 [wpt PR 11296] - HTML: Run a history navigation test in a popup to report a result, a=testonly Automatic update from web-platform-testsHTML: Run a history navigation test in a popup to report a result (#11296) Part of #11269. -- wpt-commits: 2c4b6f9df0b187e0d4c1762d175e9f736492cf91 wpt-pr: 11296
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html
testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -275933,16 +275933,21 @@
      {}
     ]
    ],
    "html/browsers/browsing-the-web/history-traversal/resources/c.html": [
     [
      {}
     ]
    ],
+   "html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html": [
+    [
+     {}
+    ]
+   ],
    "html/browsers/browsing-the-web/history-traversal/support/window-name-navigation.sub.html": [
     [
      {}
     ]
    ],
    "html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html": [
     [
      {}
@@ -552535,17 +552540,17 @@
    "3516bba907a985193bf0e1c7b4107385e053633e",
    "support"
   ],
   "css/tools/w3ctestlib/templates/implementation-report-TEMPLATE.data.tmpl": [
    "d280220881b4537bc0fc5420f43272cf4c3cae83",
    "support"
   ],
   "css/tools/w3ctestlib/templates/index.content.tmpl": [
-   "cf6c10649767fbd6cd52672b14f1176537499c44",
+   "7d92a890e62a930dd4d18c62978c1c5d28aad8cd",
    "support"
   ],
   "css/tools/w3ctestlib/templates/index.htm.tmpl": [
    "3eb39b12671c9f0c35429896c87839366fa94c91",
    "support"
   ],
   "css/tools/w3ctestlib/templates/index.xht.tmpl": [
    "d1a9699ca808770fb686c249568d958b69cc7704",
@@ -569398,38 +569403,42 @@
   "html/browsers/browsing-the-web/history-traversal/resources/c.html": [
    "00dbba64e014195aad778088ded11943cee9ac9d",
    "support"
   ],
   "html/browsers/browsing-the-web/history-traversal/same-url.html": [
    "d049bc03734690b94017819ed70b1104378cc9b4",
    "testharness"
   ],
+  "html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html": [
+   "5de9d9490705da8195853355ccb79a61bde26ffc",
+   "support"
+  ],
   "html/browsers/browsing-the-web/history-traversal/support/window-name-navigation.sub.html": [
    "79ba1608590fae1fae8aacdf809b00741e101066",
    "support"
   ],
   "html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html": [
-   "841e6ebed7f83a59b4942be07452ad5c9b8f6519",
+   "8b521df2cfb326622e871b1823fce5beade4a973",
    "support"
   ],
   "html/browsers/browsing-the-web/history-traversal/unset_context_name-1.html": [
    "b3aba3e8d9c277aaf30f8cc6860431ba793ab283",
    "testharness"
   ],
   "html/browsers/browsing-the-web/history-traversal/unset_context_name.html": [
    "d6a35d1de53be20dd8171b06349edafa4ae32a87",
    "support"
   ],
   "html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-aux-frame-navigation.sub.html": [
    "16dfcc1f1628c9dab89470a421138ffde85e866a",
    "testharness"
   ],
   "html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html": [
-   "74c59d584d8523ce523a26452767d6212d010234",
+   "0484b0af760bdb7896ec47554c78767e8e0ccdeb",
    "testharness"
   ],
   "html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-sub-frame-navigation.sub.html": [
    "498803de18a2ac26f3d5bb19a470ad058cefa9ac",
    "testharness"
   ],
   "html/browsers/browsing-the-web/history-traversal/window-name-after-same-origin-aux-frame-navigation.sub.html": [
    "2b0496b919110cc5996c79afdd420905e1d48ea6",
@@ -570451,17 +570460,17 @@
    "e368f4e64de7bd7a14576640518fb7c61189cc34",
    "manual"
   ],
   "html/browsers/history/the-history-interface/traverse_the_history_1-1.html": [
    "e193b9c985c8aca43201e8f09770996ceab67fb4",
    "support"
   ],
   "html/browsers/history/the-history-interface/traverse_the_history_1.html": [
-   "1b48bb6c67f00a5b387479f9c1ac21a2de702dd9",
+   "73fa8d1b4660315ab5e0d130377eb5252d87bb03",
    "testharness"
   ],
   "html/browsers/history/the-history-interface/traverse_the_history_2-1.html": [
    "90ebdf45c388fc3afe76ad16036e953ceb38d83e",
    "support"
   ],
   "html/browsers/history/the-history-interface/traverse_the_history_2.html": [
    "fa3279fe44df14a2057c9f14cdbaae99120c65c6",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+</head>
+<body>
+    <script>
+        document.location = "window-name-navigation.sub.html?hostname={{domains[www1]}}&shouldhavename=false&sendmessage=true";
+    </script>
+</body>
+</html>
--- a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html
@@ -1,22 +1,24 @@
 <script src='/resources/testharness.js'></script>
 <script src='/resources/testharnessreport.js'></script>
 <script>
+  setup({explicit_done: true})
   function process_test_result(passed, test_name) {
     if ({{GET[sendmessage]}}) {
       if (window.opener) {
         window.opener.postMessage(passed, "*");
       } else {
         parent.postMessage(passed, "*");
       }
     } else {
       test(function(t) {
         assert_equals(passed, true);
       }, test_name);
+      done();
     }
   }
 
   if ({{GET[shouldhavename]}}) {
     process_test_result(window.name == "test", "Test that window name is present");
   } else {
     process_test_result(window.name == "", "Test that window name is not present");
   }
--- a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html
@@ -1,13 +1,24 @@
 <!DOCTYPE HTML>
 <html>
 <head>
-    <!-- window.name should equal "" after a cross-origin main frame navigation. -->
     <script src='/resources/testharness.js'></script>
     <script src='/resources/testharnessreport.js'></script>
 </head>
 <body>
+    <button id="button" onclick="popup();">open popup</button>
     <script>
-        document.location = "support/window-name-navigation.sub.html?hostname={{domains[www1]}}&shouldhavename=false&sendmessage=false";
+    function popup() {
+      window.popupWin = window.open('support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html', '_blank');
+    }
+    async_test(t => {
+      t.add_cleanup(() => {
+        popupWin.close();
+      })
+      document.getElementById('button').click();
+      onmessage = t.step_func(e => {
+        assert_true(e.data);
+      });
+    }, 'window.name should equal "" after a cross-origin main frame navigation');
     </script>
 </body>
 </html>
--- a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1.html
+++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1.html
@@ -8,21 +8,18 @@
   started = false;
   pages = []
   timer = null;
   start_test_wait = t.step_func(
     function() {
       clearTimeout(timer);
       timer = setTimeout(t.step_func(
         function() {
-          try {
-            assert_array_equals(pages, [4, 2], "Pages opened during history navigation");
-            t.done();
-          } finally {
-           // win.close();
-          }
+          assert_array_equals(pages, [4, 2], "Pages opened during history navigation");
+          t.done();
         }
       ), 500);
     }
   );
-  t.step(function() {win = window.open("history_entry.html&urls=history_entry.html,history_entry.html,traverse_the_history_1-1.html");
+  t.step(function() {win = window.open("history_entry.html?urls=history_entry.html,history_entry.html,traverse_the_history_1-1.html");
+  t.add_cleanup(() => { win.close() });
 });
 </script>