Bug 1492127 - Split browser_blockingIndexedDb.js into browser_blockingIndexedDb.js and browser_blockingIndexedDbInWorkers.js to give it more breathing room timeout-wise r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 10 Oct 2018 19:19:09 +0000
changeset 496341 161743a69d9a74f2cc5ea7cfc2e8f65c56a4ec2a
parent 496340 bea77a4e96999378c7c8dc1dbc90bbc585171ca9
child 496342 aafdbf2213ec4463e830f810dbb71016f5e49c5f
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
bugs1492127
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 1492127 - Split browser_blockingIndexedDb.js into browser_blockingIndexedDb.js and browser_blockingIndexedDbInWorkers.js to give it more breathing room timeout-wise r=baku Depends on D8175 Differential Revision: https://phabricator.services.mozilla.com/D8176
toolkit/components/antitracking/test/browser/browser.ini
toolkit/components/antitracking/test/browser/browser_blockingIndexedDb.js
toolkit/components/antitracking/test/browser/browser_blockingIndexedDbInWorkers.js
--- a/toolkit/components/antitracking/test/browser/browser.ini
+++ b/toolkit/components/antitracking/test/browser/browser.ini
@@ -16,16 +16,17 @@ support-files =
   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_blockingIndexedDbInWorkers.js]
 [browser_blockingLocalStorage.js]
 skip-if = serviceworker_e10s
 [browser_blockingSessionStorage.js]
 skip-if = serviceworker_e10s
 [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
--- a/toolkit/components/antitracking/test/browser/browser_blockingIndexedDb.js
+++ b/toolkit/components/antitracking/test/browser/browser_blockingIndexedDb.js
@@ -16,77 +16,16 @@ AntiTracking.runTest("IndexedDB",
   },
   // Cleanup callback
   async _ => {
     await new Promise(resolve => {
       Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
     });
   });
 
-AntiTracking.runTest("IndexedDB in workers",
-  async _ => {
-    function blockCode() {
-      try {
-        indexedDB.open("test", "1");
-        postMessage(false);
-      } catch (e) {
-        postMessage(e.name == "SecurityError");
-      }
-    }
-
-    let blob = new Blob([blockCode.toString() + "; blockCode();"]);
-    ok(blob, "Blob has been created");
-
-    let blobURL = URL.createObjectURL(blob);
-    ok(blobURL, "Blob URL has been created");
-
-    let worker = new Worker(blobURL);
-    ok(worker, "Worker has been created");
-
-    await new Promise((resolve, reject) => {
-      worker.onmessage = function(e) {
-        if (e) {
-          resolve();
-        } else {
-          reject();
-        }
-      };
-    });
-  },
-  async _ => {
-    function nonBlockCode() {
-      indexedDB.open("test", "1");
-      postMessage(true);
-    }
-
-    let blob = new Blob([nonBlockCode.toString() + "; nonBlockCode();"]);
-    ok(blob, "Blob has been created");
-
-    let blobURL = URL.createObjectURL(blob);
-    ok(blobURL, "Blob URL has been created");
-
-    let worker = new Worker(blobURL);
-    ok(worker, "Worker has been created");
-
-    await new Promise((resolve, reject) => {
-      worker.onmessage = function(e) {
-        if (e) {
-          resolve();
-        } else {
-          reject();
-        }
-      };
-    });
-  },
-  async _ => {
-    await new Promise(resolve => {
-      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
-    });
-  });
-
 AntiTracking.runTest("IndexedDB and Storage Access API",
   // blocking callback
   async _ => {
     /* import-globals-from storageAccessAPIHelpers.js */
     await noStorageAccessInitially();
 
     try {
       indexedDB.open("test", "1");
@@ -118,120 +57,8 @@ AntiTracking.runTest("IndexedDB and Stor
   },
   // Cleanup callback
   async _ => {
     await new Promise(resolve => {
       Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
     });
   },
   null, false, false);
-
-AntiTracking.runTest("IndexedDB in workers and Storage Access API",
-  async _ => {
-    function blockCode() {
-      try {
-        indexedDB.open("test", "1");
-        postMessage(false);
-      } catch (e) {
-        postMessage(e.name == "SecurityError");
-      }
-    }
-    function nonBlockCode() {
-      indexedDB.open("test", "1");
-      postMessage(true);
-    }
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await noStorageAccessInitially();
-
-    let blob = new Blob([blockCode.toString() + "; blockCode();"]);
-    ok(blob, "Blob has been created");
-
-    let blobURL = URL.createObjectURL(blob);
-    ok(blobURL, "Blob URL has been created");
-
-    let worker = new Worker(blobURL);
-    ok(worker, "Worker has been created");
-
-    await new Promise((resolve, reject) => {
-      worker.onmessage = function(e) {
-        if (e) {
-          resolve();
-        } else {
-          reject();
-        }
-      };
-    });
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await callRequestStorageAccess();
-
-    blob = new Blob([nonBlockCode.toString() + "; nonBlockCode();"]);
-    ok(blob, "Blob has been created");
-
-    blobURL = URL.createObjectURL(blob);
-    ok(blobURL, "Blob URL has been created");
-
-    worker = new Worker(blobURL);
-    ok(worker, "Worker has been created");
-
-    await new Promise((resolve, reject) => {
-      worker.onmessage = function(e) {
-        if (e) {
-          resolve();
-        } else {
-          reject();
-        }
-      };
-    });
-  },
-  async _ => {
-    function nonBlockCode() {
-      indexedDB.open("test", "1");
-      postMessage(true);
-    }
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await noStorageAccessInitially();
-
-    let blob = new Blob([nonBlockCode.toString() + "; nonBlockCode();"]);
-    ok(blob, "Blob has been created");
-
-    let blobURL = URL.createObjectURL(blob);
-    ok(blobURL, "Blob URL has been created");
-
-    let worker = new Worker(blobURL);
-    ok(worker, "Worker has been created");
-
-    await new Promise((resolve, reject) => {
-      worker.onmessage = function(e) {
-        if (e) {
-          resolve();
-        } else {
-          reject();
-        }
-      };
-    });
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await callRequestStorageAccess();
-
-    // For non-tracking windows, calling the API is a no-op
-
-    worker = new Worker(blobURL);
-    ok(worker, "Worker has been created");
-
-    await new Promise((resolve, reject) => {
-      worker.onmessage = function(e) {
-        if (e) {
-          resolve();
-        } else {
-          reject();
-        }
-      };
-    });
-  },
-  async _ => {
-    await new Promise(resolve => {
-      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
-    });
-  },
-  null, false, false);
copy from toolkit/components/antitracking/test/browser/browser_blockingIndexedDb.js
copy to toolkit/components/antitracking/test/browser/browser_blockingIndexedDbInWorkers.js
--- a/toolkit/components/antitracking/test/browser/browser_blockingIndexedDb.js
+++ b/toolkit/components/antitracking/test/browser/browser_blockingIndexedDbInWorkers.js
@@ -1,31 +1,8 @@
-AntiTracking.runTest("IndexedDB",
-  // blocking callback
-  async _ => {
-    try {
-      indexedDB.open("test", "1");
-      ok(false, "IDB should be blocked");
-    } catch (e) {
-      ok(true, "IDB should be blocked");
-      is(e.name, "SecurityError", "We want a security error message.");
-    }
-  },
-  // non-blocking callback
-  async _ => {
-    indexedDB.open("test", "1");
-    ok(true, "IDB should be allowed");
-  },
-  // Cleanup callback
-  async _ => {
-    await new Promise(resolve => {
-      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
-    });
-  });
-
 AntiTracking.runTest("IndexedDB in workers",
   async _ => {
     function blockCode() {
       try {
         indexedDB.open("test", "1");
         postMessage(false);
       } catch (e) {
         postMessage(e.name == "SecurityError");
@@ -77,58 +54,16 @@ AntiTracking.runTest("IndexedDB in worke
     });
   },
   async _ => {
     await new Promise(resolve => {
       Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
     });
   });
 
-AntiTracking.runTest("IndexedDB and Storage Access API",
-  // blocking callback
-  async _ => {
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await noStorageAccessInitially();
-
-    try {
-      indexedDB.open("test", "1");
-      ok(false, "IDB should be blocked");
-    } catch (e) {
-      ok(true, "IDB should be blocked");
-      is(e.name, "SecurityError", "We want a security error message.");
-    }
-
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await callRequestStorageAccess();
-
-    indexedDB.open("test", "1");
-    ok(true, "IDB should be allowed");
-  },
-  // non-blocking callback
-  async _ => {
-    /* import-globals-from storageAccessAPIHelpers.js */
-    await noStorageAccessInitially();
-
-    indexedDB.open("test", "1");
-    ok(true, "IDB should be allowed");
-
-    await callRequestStorageAccess();
-
-    // For non-tracking windows, calling the API is a no-op
-    indexedDB.open("test", "1");
-    ok(true, "IDB should be allowed");
-  },
-  // Cleanup callback
-  async _ => {
-    await new Promise(resolve => {
-      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
-    });
-  },
-  null, false, false);
-
 AntiTracking.runTest("IndexedDB in workers and Storage Access API",
   async _ => {
     function blockCode() {
       try {
         indexedDB.open("test", "1");
         postMessage(false);
       } catch (e) {
         postMessage(e.name == "SecurityError");