Bug 1331899 - Stop navigation timing test loading a random page from the internet, r=Ms2ger draft
authorJames Graham <james@hoppipolla.co.uk>
Thu, 12 Jan 2017 14:54:30 +0000
changeset 462972 121d1154ba050b25db3aace8eea6aa424e47612e
parent 462971 8421a79719237042e300873834f462d27f568bcd
child 462973 98270873904d89d6ecd1a5be85788531aebde985
child 462995 f51ff202bd6c35119220687f5227f942d269d613
push id41928
push userbmo:james@hoppipolla.co.uk
push dateWed, 18 Jan 2017 10:52:19 +0000
reviewersMs2ger
bugs1331899
milestone53.0a1
Bug 1331899 - Stop navigation timing test loading a random page from the internet, r=Ms2ger MozReview-Commit-ID: 72WHHLcCu4k
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/navigation-timing/nav2_test_unloadEvents_previous_document_cross_origin.html
testing/web-platform/tests/navigation-timing/nav2_test_unloadEvents_previous_document_cross_origin.sub.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -97515,19 +97515,19 @@
     ]
    ],
    "navigation-timing/nav2_test_unloadEvents_no_previous_document.html": [
     [
      "/navigation-timing/nav2_test_unloadEvents_no_previous_document.html",
      {}
     ]
    ],
-   "navigation-timing/nav2_test_unloadEvents_previous_document_cross_origin.html": [
-    [
-     "/navigation-timing/nav2_test_unloadEvents_previous_document_cross_origin.html",
+   "navigation-timing/nav2_test_unloadEvents_previous_document_cross_origin.sub.html": [
+    [
+     "/navigation-timing/nav2_test_unloadEvents_previous_document_cross_origin.sub.html",
      {}
     ]
    ],
    "navigation-timing/nav2_test_unloadEvents_with_cross_origin_redirects.html": [
     [
      "/navigation-timing/nav2_test_unloadEvents_with_cross_origin_redirects.html",
      {}
     ]
@@ -179140,18 +179140,18 @@
   "navigation-timing/nav2_test_unique_nav_instances.html": [
    "83667f749579b6ed99f4f8606300d17aa0bf3fcb",
    "testharness"
   ],
   "navigation-timing/nav2_test_unloadEvents_no_previous_document.html": [
    "80fb2d6649d7ec4beca231fe93f45854b4f3a6b6",
    "testharness"
   ],
-  "navigation-timing/nav2_test_unloadEvents_previous_document_cross_origin.html": [
-   "0a42cebb180db65c8a99ad86fba56af21b9e4c65",
+  "navigation-timing/nav2_test_unloadEvents_previous_document_cross_origin.sub.html": [
+   "9c033f64f9bfc2f4ffd346a68324b4a9ad7bc841",
    "testharness"
   ],
   "navigation-timing/nav2_test_unloadEvents_with_cross_origin_redirects.html": [
    "60d8d4037939b032d51179b6c979b5e9b6556883",
    "testharness"
   ],
   "navigation-timing/nav2_test_unloadEvents_with_previous_document.html": [
    "84dd54123074e2ccc3ecdaf1b77b4730f11d47c6",
deleted file mode 100644
--- a/testing/web-platform/tests/navigation-timing/nav2_test_unloadEvents_previous_document_cross_origin.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <meta charset="utf-8" />
-        <title>Navigation Timing 2 WPT</title>
-        <link rel="author" title="Google" href="http://www.google.com/" />
-        <link rel="help" href="http://www.w3.org/TR/navigation-timing-2/#sec-PerformanceNavigationTiming"/>
-        <script src="/resources/testharness.js"></script>
-        <script src="/resources/testharnessreport.js"></script>
-        <script src="/common/utils.js"></script>
-        <script>
-
-            function onload_test()
-            {
-                var reload_frame = document.getElementById("frameContext");
-                reload_frame.onload = do_test;
-                reload_frame.contentWindow.location.href = "resources/blank_page_green.html";
-            }
-
-            function do_test()
-            {
-                var newNavTiming = document.getElementById("frameContext").contentWindow.performance.getEntriesByType("navigation")[0];
-                assert_equals(newNavTiming.type, "navigate", "Expected navigation type to be navigate.");
-                assert_equals(newNavTiming.unloadEventStart, 0, "Expected unloadEventStart to be 0.");
-                assert_equals(newNavTiming.unloadEventEnd, 0, "Expected unloadEventEnd to be 0.");
-                done();
-            }
-        </script>
-    </head>
-    <body>
-        <h1>Description</h1>
-        <p>This test validates the value of window.performance.getEntriesByType("navigation")[0].(type/unloadEventEnd/unloadEventStart) with a navigation on top of a cross-origin document.</p>
-
-        <p>This page should be loaded with a green background frame below. The frame will be automatically reloaded
-        and then verified that
-        <ul>
-            <li>The window.performance.getEntriesByType("navigation").type = "navigate"</li>
-            <li>The window.performance.getEntriesByType("navigation").unloadEventStart = 0</li>
-            <li>The window.performance.getEntriesByType("navigation").unloadEventEnd = 0</li>
-        </ul>
-        </p>
-
-        <iframe id="frameContext" onload="onload_test();" src="http://www.apple.com" style="width: 250px; height: 250px;"></iframe>
-    </body>
-</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/navigation-timing/nav2_test_unloadEvents_previous_document_cross_origin.sub.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="utf-8" />
+        <title>Navigation Timing 2 WPT</title>
+        <link rel="author" title="Google" href="http://www.google.com/" />
+        <link rel="help" href="http://www.w3.org/TR/navigation-timing-2/#sec-PerformanceNavigationTiming"/>
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <script src="/common/utils.js"></script>
+        <script>
+
+            function onload_test()
+            {
+                var reload_frame = document.getElementById("frameContext");
+                reload_frame.onload = do_test;
+                reload_frame.contentWindow.location.href = "resources/blank_page_green.html";
+            }
+
+            function do_test()
+            {
+                var newNavTiming = document.getElementById("frameContext").contentWindow.performance.getEntriesByType("navigation")[0];
+                assert_equals(newNavTiming.type, "navigate", "Expected navigation type to be navigate.");
+                assert_equals(newNavTiming.unloadEventStart, 0, "Expected unloadEventStart to be 0.");
+                assert_equals(newNavTiming.unloadEventEnd, 0, "Expected unloadEventEnd to be 0.");
+                done();
+            }
+        </script>
+    </head>
+    <body>
+        <h1>Description</h1>
+        <p>This test validates the value of window.performance.getEntriesByType("navigation")[0].(type/unloadEventEnd/unloadEventStart) with a navigation on top of a cross-origin document.</p>
+
+        <p>This page should be loaded with a green background frame below. The frame will be automatically reloaded
+        and then verified that
+        <ul>
+            <li>The window.performance.getEntriesByType("navigation").type = "navigate"</li>
+            <li>The window.performance.getEntriesByType("navigation").unloadEventStart = 0</li>
+            <li>The window.performance.getEntriesByType("navigation").unloadEventEnd = 0</li>
+        </ul>
+        </p>
+
+        <iframe id="frameContext" onload="onload_test();" src="{{location[scheme]}}://{{domains[www2]}}:{{ports[http][0]}}/common/blank.html" style="width: 250px; height: 250px;"></iframe>
+    </body>
+</html>