Bug 1493971 - Split browser_blockingStorage.js into browser_blockingLocalStorage.js and browser_blockingSessionStorage.js to give it more breathing room timeout-wise r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 09 Oct 2018 21:41:55 +0000
changeset 440337 7e925d47de47a3c5775c6169c039e9240fa4f21b
parent 440336 f92dcf5319ae2b9f1a305c0e155c463584c5fdf2
child 440338 2ba3a8f9424d711a83765981eb8dedb50944e507
push id70638
push usereakhgari@mozilla.com
push dateTue, 09 Oct 2018 21:42:34 +0000
treeherderautoland@7e925d47de47 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1493971
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 1493971 - Split browser_blockingStorage.js into browser_blockingLocalStorage.js and browser_blockingSessionStorage.js to give it more breathing room timeout-wise r=baku Differential Revision: https://phabricator.services.mozilla.com/D7231
toolkit/components/antitracking/test/browser/browser.ini
toolkit/components/antitracking/test/browser/browser_blockingLocalStorage.js
toolkit/components/antitracking/test/browser/browser_blockingSessionStorage.js
toolkit/components/antitracking/test/browser/browser_blockingStorage.js
--- a/toolkit/components/antitracking/test/browser/browser.ini
+++ b/toolkit/components/antitracking/test/browser/browser.ini
@@ -13,17 +13,19 @@ support-files =
   3rdPartyOpenUI.html
   empty.js
   popup.html
 
 [browser_backgroundImageAssertion.js]
 [browser_blockingCookies.js]
 support-files = server.sjs
 [browser_blockingIndexedDb.js]
-[browser_blockingStorage.js]
+[browser_blockingLocalStorage.js]
+skip-if = serviceworker_e10s
+[browser_blockingSessionStorage.js]
 skip-if = serviceworker_e10s
 [browser_blockingWorkers.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]
rename from toolkit/components/antitracking/test/browser/browser_blockingStorage.js
rename to toolkit/components/antitracking/test/browser/browser_blockingLocalStorage.js
--- a/toolkit/components/antitracking/test/browser/browser_blockingStorage.js
+++ b/toolkit/components/antitracking/test/browser/browser_blockingLocalStorage.js
@@ -13,35 +13,16 @@ AntiTracking.runTest("localStorage",
     ok(true, "LocalStorage is allowed");
   },
   async _ => {
     await new Promise(resolve => {
       Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
     });
   });
 
-AntiTracking.runTest("sessionStorage",
-  async _ => {
-    sessionStorage.foo = 42;
-    ok(true, "SessionStorage is always allowed");
-  },
-  async _ => {
-    sessionStorage.foo = 42;
-    ok(true, "SessionStorage is always allowed");
-  },
-  async _ => {
-    await new Promise(resolve => {
-      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
-    });
-  },
-  [],
-  true,
-  true,
-  false);
-
 AntiTracking.runTest("localStorage and Storage Access API",
   async _ => {
     let hasAccess = await document.hasStorageAccess();
     ok(!hasAccess, "Doesn't yet have storage access");
 
     try {
       localStorage.foo = 42;
       ok(false, "LocalStorage cannot be used!");
@@ -93,65 +74,8 @@ AntiTracking.runTest("localStorage and S
     ok(true, "LocalStorage is allowed");
   },
   async _ => {
     await new Promise(resolve => {
       Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
     });
   },
   null, false, false);
-
-AntiTracking.runTest("sessionStorage and Storage Access API",
-  async _ => {
-    let hasAccess = await document.hasStorageAccess();
-    ok(!hasAccess, "Doesn't yet have storage access");
-
-    sessionStorage.foo = 42;
-    ok(true, "SessionStorage is always allowed");
-
-    let dwu = SpecialPowers.getDOMWindowUtils(window);
-    let helper = dwu.setHandlingUserInput(true);
-
-    let p;
-    try {
-      p = document.requestStorageAccess();
-    } finally {
-      helper.destruct();
-    }
-    await p;
-
-    hasAccess = await document.hasStorageAccess();
-    ok(hasAccess, "Now has storage access");
-
-    sessionStorage.foo = 42;
-    ok(true, "SessionStorage is allowed after calling the storage access API too");
-  },
-  async _ => {
-    let hasAccess = await document.hasStorageAccess();
-    ok(!hasAccess, "Doesn't yet have storage access");
-
-    sessionStorage.foo = 42;
-    ok(true, "SessionStorage is always allowed");
-
-    let dwu = SpecialPowers.getDOMWindowUtils(window);
-    let helper = dwu.setHandlingUserInput(true);
-
-    let p;
-    try {
-      p = document.requestStorageAccess();
-    } finally {
-      helper.destruct();
-    }
-    await p;
-
-    hasAccess = await document.hasStorageAccess();
-    ok(hasAccess, "Now has storage access");
-
-    // For non-tracking windows, calling the API is a no-op
-    sessionStorage.foo = 42;
-    ok(true, "SessionStorage is allowed after calling the storage access API too");
-  },
-  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_blockingSessionStorage.js
@@ -0,0 +1,75 @@
+AntiTracking.runTest("sessionStorage",
+  async _ => {
+    sessionStorage.foo = 42;
+    ok(true, "SessionStorage is always allowed");
+  },
+  async _ => {
+    sessionStorage.foo = 42;
+    ok(true, "SessionStorage is always allowed");
+  },
+  async _ => {
+    await new Promise(resolve => {
+      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
+    });
+  },
+  [],
+  true,
+  true,
+  false);
+
+AntiTracking.runTest("sessionStorage and Storage Access API",
+  async _ => {
+    let hasAccess = await document.hasStorageAccess();
+    ok(!hasAccess, "Doesn't yet have storage access");
+
+    sessionStorage.foo = 42;
+    ok(true, "SessionStorage is always allowed");
+
+    let dwu = SpecialPowers.getDOMWindowUtils(window);
+    let helper = dwu.setHandlingUserInput(true);
+
+    let p;
+    try {
+      p = document.requestStorageAccess();
+    } finally {
+      helper.destruct();
+    }
+    await p;
+
+    hasAccess = await document.hasStorageAccess();
+    ok(hasAccess, "Now has storage access");
+
+    sessionStorage.foo = 42;
+    ok(true, "SessionStorage is allowed after calling the storage access API too");
+  },
+  async _ => {
+    let hasAccess = await document.hasStorageAccess();
+    ok(!hasAccess, "Doesn't yet have storage access");
+
+    sessionStorage.foo = 42;
+    ok(true, "SessionStorage is always allowed");
+
+    let dwu = SpecialPowers.getDOMWindowUtils(window);
+    let helper = dwu.setHandlingUserInput(true);
+
+    let p;
+    try {
+      p = document.requestStorageAccess();
+    } finally {
+      helper.destruct();
+    }
+    await p;
+
+    hasAccess = await document.hasStorageAccess();
+    ok(hasAccess, "Now has storage access");
+
+    // For non-tracking windows, calling the API is a no-op
+    sessionStorage.foo = 42;
+    ok(true, "SessionStorage is allowed after calling the storage access API too");
+  },
+  async _ => {
+    await new Promise(resolve => {
+      Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
+    });
+  },
+  null, false, false);