Bug 1503852 - Split out prefetch test from fetch-destination.https.html, and disable for Firefox. r=jgraham
authorMike Conley <mconley@mozilla.com>
Mon, 26 Nov 2018 17:00:02 +0000
changeset 507340 d534baf412772ee14e0d89f651267cb4dc2a3f6c
parent 507339 95d8c0fa8d6496f12cbff5709f4e816a5475bfc3
child 507341 79ae8ec996e64730196a994093f3ff8bb4af1384
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1503852
milestone65.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 1503852 - Split out prefetch test from fetch-destination.https.html, and disable for Firefox. r=jgraham Differential Revision: https://phabricator.services.mozilla.com/D12944
testing/web-platform/meta/fetch/api/request/destination/fetch-destination-prefetch.https.html.ini
testing/web-platform/meta/fetch/api/request/destination/fetch-destination.https.html.ini
testing/web-platform/tests/fetch/api/request/destination/fetch-destination-prefetch.https.html
testing/web-platform/tests/fetch/api/request/destination/fetch-destination.https.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/fetch/api/request/destination/fetch-destination-prefetch.https.html.ini
@@ -0,0 +1,2 @@
+[fetch-destination-prefetch.https.html]
+  disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1500089
deleted file mode 100644
--- a/testing/web-platform/meta/fetch/api/request/destination/fetch-destination.https.html.ini
+++ /dev/null
@@ -1,12 +0,0 @@
-[fetch-destination.https.html]
-  prefs: [browser.tabs.remote.separatePrivilegedContentProcess:true]
-  expected:
-    if not e10s and debug and (os == "linux") and (processor == "x86") and (bits == 32): OK
-    if asan: OK
-    TIMEOUT
-
-  [HTMLLinkElement with rel=prefetch fetches with an empty string Request.destination]
-    expected:
-      if not e10s and debug and (os == "linux") and (processor == "x86") and (bits == 32): PASS
-      if asan: PASS
-      TIMEOUT
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/fetch/api/request/destination/fetch-destination-prefetch.https.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Fetch destination test for prefetching</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="/common/media.js"></script>
+<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
+<script>
+let frame;
+
+// Set up the service worker and the frame.
+promise_test(t => {
+    const kScope = 'resources/empty.https.html';
+    const kScript = 'resources/fetch-destination-worker.js';
+    return service_worker_unregister_and_register(t, kScript, kScope)
+      .then(registration => {
+          add_completion_callback(() => {
+              registration.unregister();
+            });
+
+          return wait_for_state(t, registration.installing, 'activated');
+        })
+      .then(() => {
+          return with_iframe(kScope);
+        })
+      .then(f => {
+          frame = f;
+          add_completion_callback(() => { f.remove(); });
+        });
+  }, 'Initialize global state');
+
+// HTMLLinkElement with rel=prefetch - empty string destination
+promise_test(async t => {
+  await new Promise((resolve, reject) => {
+      let node = frame.contentWindow.document.createElement("link");
+      node.rel = "prefetch";
+      node.onload = resolve;
+      node.onerror = reject;
+      node.href = "dummy?dest=";
+      frame.contentWindow.document.body.appendChild(node);
+  }).catch(() => {
+      assert_unreached("Fetch errored.");
+  });
+}, 'HTMLLinkElement with rel=prefetch fetches with an empty string Request.destination');
+
+</script>
--- a/testing/web-platform/tests/fetch/api/request/destination/fetch-destination.https.html
+++ b/testing/web-platform/tests/fetch/api/request/destination/fetch-destination.https.html
@@ -420,23 +420,9 @@ promise_test(async t => {
       node.onerror = reject;
       node.href = "dummy?dest=manifest";
       frame.contentWindow.document.body.appendChild(node);
   }).catch(() => {
       assert_unreached("Fetch errored.");
   });
 }, 'HTMLLinkElement with rel=preload and as=manifest fetches with a "manifest" Request.destination');
 
-// HTMLLinkElement with rel=prefetch - empty string destination
-promise_test(async t => {
-  await new Promise((resolve, reject) => {
-      let node = frame.contentWindow.document.createElement("link");
-      node.rel = "prefetch";
-      node.onload = resolve;
-      node.onerror = reject;
-      node.href = "dummy?dest=";
-      frame.contentWindow.document.body.appendChild(node);
-  }).catch(() => {
-      assert_unreached("Fetch errored.");
-  });
-}, 'HTMLLinkElement with rel=prefetch fetches with an empty string Request.destination');
-
 </script>