Bug 1302621 - Fix buggy history traversal test. r=Ms2ger, a=test-only
authorJames Graham <james@hoppipolla.co.uk>
Tue, 24 Jan 2017 07:55:00 +0100
changeset 375634 0405ffe4f6c33ff8c4f7f9172e9c63293f376c82
parent 375633 48f7caa80dfc6cafc778269b12e9e69379111c56
child 375635 e0aa7e76bdc5d2074e1a0156863038a4b75cdf7f
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger, test-only
bugs1302621
milestone53.0a2
Bug 1302621 - Fix buggy history traversal test. r=Ms2ger, a=test-only MozReview-Commit-ID: Lc7BDuxEWgY
testing/web-platform/meta/MANIFEST.json
testing/web-platform/meta/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html.ini
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -43771,16 +43771,21 @@
      {}
     ]
    ],
    "html/browsers/browsing-the-web/history-traversal/MANIFEST": [
     [
      {}
     ]
    ],
+   "html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html": [
+    [
+     {}
+    ]
+   ],
    "html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html": [
     [
      {}
     ]
    ],
    "html/browsers/browsing-the-web/history-traversal/browsing_context_name-2.html": [
     [
      {}
@@ -161744,16 +161749,20 @@
   "html/browsers/browsing-the-web/history-traversal/MANIFEST": [
    "77f7e6de345d8645865225173f5d6f403a80dee3",
    "support"
   ],
   "html/browsers/browsing-the-web/history-traversal/PopStateEvent.html": [
    "2a7ed0827fc61af7b3bdd238577887aff1902ea7",
    "testharness"
   ],
+  "html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html": [
+   "059f6738127f25477f8c17dc3e79f2dc7ea64465",
+   "support"
+  ],
   "html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html": [
    "2eda3fa32e3918ee4d75989fc2e6f03582ce6e75",
    "support"
   ],
   "html/browsers/browsing-the-web/history-traversal/browsing_context_name-2.html": [
    "aa5a60cde724b2c6dea750f850eaacc73ae5a955",
    "support"
   ],
@@ -161761,17 +161770,17 @@
    "c5a17559438e576642a8beb8748f3011ca100b34",
    "support"
   ],
   "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": [
-   "f0c6499b06130312c700a6f25c5fa75664603646",
+   "87d7d141b05200ad3db0660d9d8d8bdf7876ee4b",
    "testharness"
   ],
   "html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html": [
    "335497f240accd4eec21d8da8401ce2c31af492e",
    "testharness"
   ],
   "html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html": [
    "d0fb79d8beac15f3dc2ad8ad3d383b37ea1f108f",
@@ -200709,17 +200718,17 @@
    "eee8ff07b3ec5e83e5f18305f5bc00eb72468443",
    "testharness"
   ],
   "web-animations/animation-model/animation-types/interpolation-per-property.html": [
    "0fc8dba5b4871a5c6ca2647e403b1896e1f35030",
    "testharness"
   ],
   "web-animations/animation-model/animation-types/property-list.js": [
-   "d25c1e99f64a7dc2a883b7d1334bb2d37e657a0e",
+   "09135b91237467c4fbeeda3fd7b4d459a82ff4fb",
    "support"
   ],
   "web-animations/animation-model/animation-types/property-types.js": [
    "ebccba780b163032d4aba54cdbbf1b892464bcfa",
    "support"
   ],
   "web-animations/animation-model/animation-types/spacing-keyframes-filters.html": [
    "cd3ad9e0008aa23d2a46a27b7c2ff190d8acd7d1",
deleted file mode 100644
--- a/testing/web-platform/meta/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[browsing_context_name.html]
-  type: testharness
-  disabled:
-    if (os == "linux") and debug and (bits == 32): https://bugzilla.mozilla.org/show_bug.cgi?id=1215461
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html
@@ -0,0 +1,35 @@
+<iframe id="test"></iframe>
+<script>
+var opener = window.opener;
+var t = opener.t;
+var f = document.getElementById("test");
+var l = opener.document.getElementById("step_log");
+
+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 = "browsing_context_name-2.html"
+  },
+  () => {
+    opener.assert_equals(f.contentWindow.name, "test1");
+    opener.assert_equals(history.length, 2);
+    history.back()
+  },
+  () => {
+    opener.assert_equals(f.contentWindow.name, "test1", "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.html
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html
@@ -1,42 +1,13 @@
 <!doctype html>
 <title>Retaining window.name on 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 = "browsing_context_name-2.html"; setTimeout(next, 500)},
-  function() {
-               assert_equals(f.contentWindow.name, "test1");
-               setTimeout(next, 0);
-             },
-  function() {history.back(); setTimeout(next, 500)},
-  function() {
-               assert_equals(f.contentWindow.name, "test1", "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 = setTimeout(next, 0);
+<script>
+var t = async_test();
+t.step(() => {
+  win = window.open("browsing_context_name-0.html");
+  t.add_cleanup(() => win.close());
+});
 </script>