Bug 1494401 - Split browser_blockingWorkers.js into three separate tests to give it more breathing room timeout-wise r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 10 Oct 2018 19:19:07 +0000
changeset 496334 da3163c05c7ee076a6f91c25d4fe5bf5bcb13429
parent 496333 81dd098adbd8984f9491eae22dac152cf4fb2d71
child 496335 2084a929ec4cbf31dda4df9935ba4bb38002a6bd
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1494401
milestone64.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 1494401 - Split browser_blockingWorkers.js into three separate tests to give it more breathing room timeout-wise r=baku Differential Revision: https://phabricator.services.mozilla.com/D8175
toolkit/components/antitracking/test/browser/browser.ini
toolkit/components/antitracking/test/browser/browser_blockingDOMCache.js
toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js
toolkit/components/antitracking/test/browser/browser_blockingSharedWorkers.js
toolkit/components/antitracking/test/browser/browser_blockingWorkers.js
--- a/toolkit/components/antitracking/test/browser/browser.ini
+++ b/toolkit/components/antitracking/test/browser/browser.ini
@@ -13,22 +13,26 @@ support-files =
   3rdPartyOpenUI.html
   empty.js
   popup.html
   storageAccessAPIHelpers.js
 
 [browser_backgroundImageAssertion.js]
 [browser_blockingCookies.js]
 support-files = server.sjs
+[browser_blockingDOMCache.js]
+skip-if = (os == "win" && os_version == "6.1" && bits == 32 && !debug) # Bug 1491937
 [browser_blockingIndexedDb.js]
 [browser_blockingLocalStorage.js]
 skip-if = serviceworker_e10s
 [browser_blockingSessionStorage.js]
 skip-if = serviceworker_e10s
-[browser_blockingWorkers.js]
+[browser_blockingServiceWorkers.js]
+skip-if = (os == "win" && os_version == "6.1" && bits == 32 && !debug) # Bug 1491937
+[browser_blockingSharedWorkers.js]
 skip-if = (os == "win" && os_version == "6.1" && bits == 32 && !debug) # Bug 1491937
 [browser_blockingMessaging.js]
 [browser_blockingNoOpener.js]
 [browser_existingCookiesForSubresources.js]
 [browser_imageCache1.js]
 [browser_imageCache1-1.js]
 [browser_imageCache1-2.js]
 [browser_imageCache4.js]
new file mode 100644
--- /dev/null
+++ b/toolkit/components/antitracking/test/browser/browser_blockingDOMCache.js
@@ -0,0 +1,57 @@
+requestLongerTimeout(2);
+
+AntiTracking.runTest("DOM Cache",
+  async _ => {
+    await caches.open("wow").then(
+      _ => { ok(false, "DOM Cache cannot be used!"); },
+      _ => { ok(true, "DOM Cache cannot be used!"); });
+  },
+  async _ => {
+    await caches.open("wow").then(
+      _ => { ok(true, "DOM Cache can be used!"); },
+      _ => { ok(false, "DOM Cache can be used!"); });
+  },
+  async _ => {
+    await new Promise(resolve => {
+      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
+    });
+  });
+
+AntiTracking.runTest("DOM Cache and Storage Access API",
+  async _ => {
+    /* import-globals-from storageAccessAPIHelpers.js */
+    await noStorageAccessInitially();
+
+    await caches.open("wow").then(
+      _ => { ok(false, "DOM Cache cannot be used!"); },
+      _ => { ok(true, "DOM Cache cannot be used!"); });
+
+    /* import-globals-from storageAccessAPIHelpers.js */
+    await callRequestStorageAccess();
+
+    await caches.open("wow").then(
+      _ => { ok(true, "DOM Cache can be used!"); },
+      _ => { ok(false, "DOM Cache can be used!"); });
+  },
+  async _ => {
+    /* import-globals-from storageAccessAPIHelpers.js */
+    await noStorageAccessInitially();
+
+    await caches.open("wow").then(
+      _ => { ok(true, "DOM Cache can be used!"); },
+      _ => { ok(false, "DOM Cache can be used!"); });
+
+    /* import-globals-from storageAccessAPIHelpers.js */
+    await callRequestStorageAccess();
+
+    // For non-tracking windows, calling the API is a no-op
+    await caches.open("wow").then(
+      _ => { ok(true, "DOM Cache can be used!"); },
+      _ => { ok(false, "DOM Cache can be used!"); });
+  },
+  async _ => {
+    await new Promise(resolve => {
+      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
+    });
+  },
+  null, false, false);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js
@@ -0,0 +1,81 @@
+requestLongerTimeout(2);
+
+AntiTracking.runTest("ServiceWorkers",
+  async _ => {
+    await navigator.serviceWorker.register("empty.js").then(
+      _ => { ok(false, "ServiceWorker cannot be used!"); },
+      _ => { ok(true, "ServiceWorker cannot be used!"); });
+  },
+  null,
+  async _ => {
+    await new Promise(resolve => {
+      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
+    });
+  },
+  [["dom.serviceWorkers.exemptFromPerDomainMax", true],
+   ["dom.serviceWorkers.enabled", true],
+   ["dom.serviceWorkers.testing.enabled", true]]);
+
+AntiTracking.runTest("ServiceWorkers and Storage Access API",
+  async _ => {
+    await SpecialPowers.pushPrefEnv({"set": [
+       ["dom.serviceWorkers.exemptFromPerDomainMax", true],
+       ["dom.serviceWorkers.enabled", true],
+       ["dom.serviceWorkers.testing.enabled", true],
+    ]});
+
+    /* import-globals-from storageAccessAPIHelpers.js */
+    await noStorageAccessInitially();
+
+    await navigator.serviceWorker.register("empty.js").then(
+      _ => { ok(false, "ServiceWorker cannot be used!"); },
+      _ => { ok(true, "ServiceWorker cannot be used!"); }).
+      catch(e => ok(false, "Promise rejected: " + e));
+
+    /* import-globals-from storageAccessAPIHelpers.js */
+    await callRequestStorageAccess();
+
+    await navigator.serviceWorker.register("empty.js").then(
+      reg => { ok(true, "ServiceWorker can be used!"); return reg; },
+      _ => { ok(false, "ServiceWorker cannot be used! " + _); }).then(
+      reg => reg.unregister(),
+      _ => { ok(false, "unregister failed"); }).
+      catch(e => ok(false, "Promise rejected: " + e));
+  },
+  async _ => {
+    await SpecialPowers.pushPrefEnv({"set": [
+       ["dom.serviceWorkers.exemptFromPerDomainMax", true],
+       ["dom.serviceWorkers.enabled", true],
+       ["dom.serviceWorkers.testing.enabled", true],
+    ]});
+
+    /* import-globals-from storageAccessAPIHelpers.js */
+    await noStorageAccessInitially();
+
+    await navigator.serviceWorker.register("empty.js").then(
+      reg => { ok(true, "ServiceWorker can be used!"); return reg; },
+      _ => { ok(false, "ServiceWorker cannot be used!"); }).then(
+      reg => reg.unregister(),
+      _ => { ok(false, "unregister failed"); }).
+      catch(e => ok(false, "Promise rejected: " + e));
+
+    /* import-globals-from storageAccessAPIHelpers.js */
+    await callRequestStorageAccess();
+
+    // For non-tracking windows, calling the API is a no-op
+    await navigator.serviceWorker.register("empty.js").then(
+      reg => { ok(true, "ServiceWorker can be used!"); return reg; },
+      _ => { ok(false, "ServiceWorker cannot be used!"); }).then(
+      reg => reg.unregister(),
+      _ => { ok(false, "unregister failed"); }).
+      catch(e => ok(false, "Promise rejected: " + e));
+  },
+  async _ => {
+    await new Promise(resolve => {
+      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
+    });
+  },
+  [["dom.serviceWorkers.exemptFromPerDomainMax", true],
+   ["dom.serviceWorkers.enabled", true],
+   ["dom.serviceWorkers.testing.enabled", true]],
+  false, false);
new file mode 100644
--- /dev/null
+++ b/toolkit/components/antitracking/test/browser/browser_blockingSharedWorkers.js
@@ -0,0 +1,61 @@
+requestLongerTimeout(2);
+
+AntiTracking.runTest("SharedWorkers",
+  async _ => {
+    try {
+      new SharedWorker("a.js", "foo");
+      ok(false, "SharedWorker cannot be used!");
+    } catch (e) {
+      ok(true, "SharedWorker cannot be used!");
+      is(e.name, "SecurityError", "We want a security error message.");
+    }
+  },
+  async _ => {
+    new SharedWorker("a.js", "foo");
+    ok(true, "SharedWorker is allowed");
+  },
+  async _ => {
+    await new Promise(resolve => {
+      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
+    });
+  });
+
+AntiTracking.runTest("SharedWorkers and Storage Access API",
+  async _ => {
+    /* import-globals-from storageAccessAPIHelpers.js */
+    await noStorageAccessInitially();
+
+    try {
+      new SharedWorker("a.js", "foo");
+      ok(false, "SharedWorker cannot be used!");
+    } catch (e) {
+      ok(true, "SharedWorker cannot be used!");
+      is(e.name, "SecurityError", "We want a security error message.");
+    }
+
+    /* import-globals-from storageAccessAPIHelpers.js */
+    await callRequestStorageAccess();
+
+    new SharedWorker("a.js", "foo");
+    ok(true, "SharedWorker is allowed");
+  },
+  async _ => {
+    /* import-globals-from storageAccessAPIHelpers.js */
+    await noStorageAccessInitially();
+
+    new SharedWorker("a.js", "foo");
+    ok(true, "SharedWorker is allowed");
+
+    /* import-globals-from storageAccessAPIHelpers.js */
+    await callRequestStorageAccess();
+
+    // For non-tracking windows, calling the API is a no-op
+    new SharedWorker("a.js", "bar");
+    ok(true, "SharedWorker is allowed");
+  },
+  async _ => {
+    await new Promise(resolve => {
+      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
+    });
+  },
+  null, false, false);
deleted file mode 100644
--- a/toolkit/components/antitracking/test/browser/browser_blockingWorkers.js
+++ /dev/null
@@ -1,197 +0,0 @@
-requestLongerTimeout(4);
-
-AntiTracking.runTest("SharedWorkers",
-  async _ => {
-    try {
-      new SharedWorker("a.js", "foo");
-      ok(false, "SharedWorker cannot be used!");
-    } catch (e) {
-      ok(true, "SharedWorker cannot be used!");
-      is(e.name, "SecurityError", "We want a security error message.");
-    }
-  },
-  async _ => {
-    new SharedWorker("a.js", "foo");
-    ok(true, "SharedWorker is allowed");
-  },
-  async _ => {
-    await new Promise(resolve => {
-      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
-    });
-  });
-
-AntiTracking.runTest("ServiceWorkers",
-  async _ => {
-    await navigator.serviceWorker.register("empty.js").then(
-      _ => { ok(false, "ServiceWorker cannot be used!"); },
-      _ => { ok(true, "ServiceWorker cannot be used!"); });
-  },
-  null,
-  async _ => {
-    await new Promise(resolve => {
-      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
-    });
-  },
-  [["dom.serviceWorkers.exemptFromPerDomainMax", true],
-   ["dom.serviceWorkers.enabled", true],
-   ["dom.serviceWorkers.testing.enabled", true]]);
-
-AntiTracking.runTest("DOM Cache",
-  async _ => {
-    await caches.open("wow").then(
-      _ => { ok(false, "DOM Cache cannot be used!"); },
-      _ => { ok(true, "DOM Cache cannot be used!"); });
-  },
-  async _ => {
-    await caches.open("wow").then(
-      _ => { ok(true, "DOM Cache can be used!"); },
-      _ => { ok(false, "DOM Cache can be used!"); });
-  },
-  async _ => {
-    await new Promise(resolve => {
-      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
-    });
-  });
-
-AntiTracking.runTest("SharedWorkers and Storage Access API",
-  async _ => {
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await noStorageAccessInitially();
-
-    try {
-      new SharedWorker("a.js", "foo");
-      ok(false, "SharedWorker cannot be used!");
-    } catch (e) {
-      ok(true, "SharedWorker cannot be used!");
-      is(e.name, "SecurityError", "We want a security error message.");
-    }
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await callRequestStorageAccess();
-
-    new SharedWorker("a.js", "foo");
-    ok(true, "SharedWorker is allowed");
-  },
-  async _ => {
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await noStorageAccessInitially();
-
-    new SharedWorker("a.js", "foo");
-    ok(true, "SharedWorker is allowed");
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await callRequestStorageAccess();
-
-    // For non-tracking windows, calling the API is a no-op
-    new SharedWorker("a.js", "bar");
-    ok(true, "SharedWorker is allowed");
-  },
-  async _ => {
-    await new Promise(resolve => {
-      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
-    });
-  },
-  null, false, false);
-
-AntiTracking.runTest("ServiceWorkers and Storage Access API",
-  async _ => {
-    await SpecialPowers.pushPrefEnv({"set": [
-       ["dom.serviceWorkers.exemptFromPerDomainMax", true],
-       ["dom.serviceWorkers.enabled", true],
-       ["dom.serviceWorkers.testing.enabled", true],
-    ]});
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await noStorageAccessInitially();
-
-    await navigator.serviceWorker.register("empty.js").then(
-      _ => { ok(false, "ServiceWorker cannot be used!"); },
-      _ => { ok(true, "ServiceWorker cannot be used!"); }).
-      catch(e => ok(false, "Promise rejected: " + e));
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await callRequestStorageAccess();
-
-    await navigator.serviceWorker.register("empty.js").then(
-      reg => { ok(true, "ServiceWorker can be used!"); return reg; },
-      _ => { ok(false, "ServiceWorker cannot be used! " + _); }).then(
-      reg => reg.unregister(),
-      _ => { ok(false, "unregister failed"); }).
-      catch(e => ok(false, "Promise rejected: " + e));
-  },
-  async _ => {
-    await SpecialPowers.pushPrefEnv({"set": [
-       ["dom.serviceWorkers.exemptFromPerDomainMax", true],
-       ["dom.serviceWorkers.enabled", true],
-       ["dom.serviceWorkers.testing.enabled", true],
-    ]});
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await noStorageAccessInitially();
-
-    await navigator.serviceWorker.register("empty.js").then(
-      reg => { ok(true, "ServiceWorker can be used!"); return reg; },
-      _ => { ok(false, "ServiceWorker cannot be used!"); }).then(
-      reg => reg.unregister(),
-      _ => { ok(false, "unregister failed"); }).
-      catch(e => ok(false, "Promise rejected: " + e));
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await callRequestStorageAccess();
-
-    // For non-tracking windows, calling the API is a no-op
-    await navigator.serviceWorker.register("empty.js").then(
-      reg => { ok(true, "ServiceWorker can be used!"); return reg; },
-      _ => { ok(false, "ServiceWorker cannot be used!"); }).then(
-      reg => reg.unregister(),
-      _ => { ok(false, "unregister failed"); }).
-      catch(e => ok(false, "Promise rejected: " + e));
-  },
-  async _ => {
-    await new Promise(resolve => {
-      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
-    });
-  },
-  [["dom.serviceWorkers.exemptFromPerDomainMax", true],
-   ["dom.serviceWorkers.enabled", true],
-   ["dom.serviceWorkers.testing.enabled", true]],
-  false, false);
-
-AntiTracking.runTest("DOM Cache and Storage Access API",
-  async _ => {
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await noStorageAccessInitially();
-
-    await caches.open("wow").then(
-      _ => { ok(false, "DOM Cache cannot be used!"); },
-      _ => { ok(true, "DOM Cache cannot be used!"); });
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await callRequestStorageAccess();
-
-    await caches.open("wow").then(
-      _ => { ok(true, "DOM Cache can be used!"); },
-      _ => { ok(false, "DOM Cache can be used!"); });
-  },
-  async _ => {
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await noStorageAccessInitially();
-
-    await caches.open("wow").then(
-      _ => { ok(true, "DOM Cache can be used!"); },
-      _ => { ok(false, "DOM Cache can be used!"); });
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await callRequestStorageAccess();
-
-    // For non-tracking windows, calling the API is a no-op
-    await caches.open("wow").then(
-      _ => { ok(true, "DOM Cache can be used!"); },
-      _ => { ok(false, "DOM Cache can be used!"); });
-  },
-  async _ => {
-    await new Promise(resolve => {
-      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
-    });
-  },
-  null, false, false);