Bug 1308969 - Fix cross-origin browser name test, r=Ms2ger
☠☠ backed out by 0e19b703e0df ☠ ☠
authorJames Graham <james@hoppipolla.co.uk>
Fri, 17 Feb 2017 08:06:34 +0000
changeset 343595 67538b51b43a50423bae3c400d2e3987df9531b8
parent 343594 cf2dd9d5da7e57227d44f2c5eb289bcfb1585276
child 343596 72bc1a760dddb809e14101eacff80bb650323828
push id31382
push userkwierso@gmail.com
push dateFri, 17 Feb 2017 21:41:52 +0000
treeherdermozilla-central@0930fdc4cf8e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
bugs1308969
milestone54.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 1308969 - Fix cross-origin browser name test, r=Ms2ger MozReview-Commit-ID: 49stqMka8j5
testing/web-platform/meta/MANIFEST.json
testing/web-platform/meta/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html.ini
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin-0.html
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -44234,16 +44234,21 @@
      {}
     ]
    ],
    "html/browsers/browsing-the-web/history-traversal/browsing_context_name-4.html": [
     [
      {}
     ]
    ],
+   "html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin-0.html": [
+    [
+     {}
+    ]
+   ],
    "html/browsers/browsing-the-web/history-traversal/contains.json": [
     [
      {}
     ]
    ],
    "html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank1.html": [
     [
      {}
@@ -164962,18 +164967,22 @@
   "html/browsers/browsing-the-web/history-traversal/browsing_context_name-4.html": [
    "49574225da2bf97149ccb0c486c85f1e88cb8848",
    "support"
   ],
   "html/browsers/browsing-the-web/history-traversal/browsing_context_name.html": [
    "87d7d141b05200ad3db0660d9d8d8bdf7876ee4b",
    "testharness"
   ],
+  "html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin-0.html": [
+   "a0512a75c277b22bbbcd37692580c779334ab74b",
+   "support"
+  ],
   "html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html": [
-   "7455a083f29518418a3508b8fd3ade74cb747666",
+   "80ddf5ab19d6698340820c2fa4145d4aa6960459",
    "testharness"
   ],
   "html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html": [
    "d1a0dcf7e544066d7d30454e9915fad22c6966dc",
    "testharness"
   ],
   "html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_3.html": [
    "7feaab2a60b39d697819571136463ce26936d3db",
--- a/testing/web-platform/meta/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html.ini
+++ b/testing/web-platform/meta/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html.ini
@@ -1,15 +1,4 @@
 [browsing_context_name_cross_origin.html]
   type: testharness
   [Restoring window.name on cross-origin history traversal]
-    expected:
-      if not debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
-      if not debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
-      if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-      if not debug and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-      if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
-      if debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
-      if debug and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-      if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
-      if not debug and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
-      if debug and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
-
+    expected: FAIL
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin-0.html
@@ -0,0 +1,34 @@
+<iframe id="test"></iframe>
+<script>
+var t = opener.t;
+var f = document.getElementById("test");
+var l = opener.document.getElementById("step_log");
+
+var log = function(t) {l.textContent += ("\n" + t)}
+var navigated = false;
+var steps = [
+  () => f.src = "browsing_context_name-1.html",
+  () => {
+    navigated = true;
+    opener.assert_equals(f.contentWindow.name, "test", "Initial load");
+    f.src = f.src.replace("http://", "http://www.").replace("browsing_context_name-1", "browsing_context_name-2");
+  },
+  () => {
+    // Can't test .name easily here because it's cross-origin
+    opener.assert_equals(history.length, 2);
+    history.back()
+  },
+  () => {
+    opener.assert_equals(f.contentWindow.name, "test", "After navigation");
+    t.done();
+  }
+].map((x, i) => t.step_func(() => {log("Step " + (i+1)); x()}));
+
+next = () => steps.shift()();
+
+onload = () => {
+  log("page load");
+  f.onload = () => {log("iframe onload"); next()};
+  setTimeout(next, 0);
+};
+</script>
--- a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html
@@ -1,41 +1,13 @@
 <!doctype html>
 <title>Restoring window.name on cross-origin history traversal</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
-<div id="log"></div>
 <pre id="step_log"></pre>
-<iframe id="test"></iframe>
-<script>
-
-var t = async_test(undefined, {timeout:10000});
-var f = document.getElementById("test");
-var l = document.getElementById("step_log");
-var navigated = false;
-
-log = function(t) {l.textContent += ("\n" + t)}
 
-var steps = [
-  function() {f.src = "browsing_context_name-1.html"},
-  function() {
-                navigated = true;
-                assert_equals(f.contentWindow.name, "test", "Initial load");
-                setTimeout(next, 0);
-              },
-  function() {f.src = f.src.replace("http://", "http://www.").replace("browsing_context_name-1", "browsing_context_name-2");},
-  function() {
-               setTimeout(next, 0);
-             },
-  function() {history.back(); setTimeout(next, 500)},
-  function() {
-               assert_equals(f.contentWindow.name, "test", "After navigation");
-               t.done();
-             }
-].map(function(x) {return t.step_func(function() {log("Step " + step); x()})});
-
-var step = 0;
-next = t.step_func(function() {steps[step++]()});
-
-f.onload=next;
-
-onload = function() { setTimeout(next, 0); };
+<script>
+var t = async_test();
+t.step(() => {
+  var win = window.open("browsing_context_name_cross_origin-0.html");
+  t.add_cleanup(() => win.close());
+});
 </script>