Bug 1556881 - Fix browser_partitionedLocalStorage_events.js to not assume the dom.storage.next_gen pref is live; r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 16 Jul 2019 18:58:22 +0000
changeset 483001 1d89c2f4521b5c3316ff3ebf1367993008b7ff2d
parent 483000 96372a2ff71d3db3724bde3891d3764a08a4577e
child 483002 69785244ccd7d2202f321ac075795e044d8b1d31
push id36303
push userdvarga@mozilla.com
push dateWed, 17 Jul 2019 09:36:40 +0000
treeherdermozilla-central@29e9dde37bd2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1556881
milestone70.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 1556881 - Fix browser_partitionedLocalStorage_events.js to not assume the dom.storage.next_gen pref is live; r=baku Differential Revision: https://phabricator.services.mozilla.com/D38122
toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage_events.js
--- a/toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage_events.js
+++ b/toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage_events.js
@@ -1,41 +1,37 @@
 function log(test) {
   if ("iteration" in test) {
     info(
       `Running test ${
         test.withStoragePrincipalEnabled
           ? "with storage principal enabled"
           : "without storage principal"
-      } ` +
-        `with the ${
-          test.lsngEnabled ? "new" : "old"
-        } localStorage backend and prefValue: ${test.prefValue} ` +
-        `(Test #${test.iteration + 1})`
+      } with prefValue: ${test.prefValue} (Test #${test.iteration + 1})`
     );
     test.iteration++;
   } else {
     test.iteration = 0;
     log(test);
   }
 }
 
-function runAllTests(withStoragePrincipalEnabled, lsngEnabled, prefValue) {
+function runAllTests(withStoragePrincipalEnabled, prefValue) {
   const storagePrincipalTest =
     prefValue == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER;
   const dynamicFPITest =
     prefValue ==
     Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN;
 
   if (dynamicFPITest && withStoragePrincipalEnabled) {
     // This isn't a meaningful configuration, ignore it.
     return;
   }
 
-  const test = { withStoragePrincipalEnabled, lsngEnabled, prefValue };
+  const test = { withStoragePrincipalEnabled, prefValue };
 
   // For dynamic FPI tests, we want to test the conditions as if
   // storage principal was enabled, so from now on we set this variable to
   // true.
   if (dynamicFPITest) {
     withStoragePrincipalEnabled = true;
   }
 
@@ -74,17 +70,16 @@ function runAllTests(withStoragePrincipa
         [
           "privacy.restrict3rdpartystorage.partitionedHosts",
           "tracking.example.org,not-tracking.example.com",
         ],
         [
           "privacy.storagePrincipal.enabledForTrackers",
           storagePrincipalPrefValue,
         ],
-        ["dom.storage.next_gen", lsngEnabled],
       ],
     });
 
     await UrlClassifierTestUtils.addTestTrackers();
 
     info("Creating a non-tracker top-level context");
     let normalTab = BrowserTestUtils.addTab(gBrowser, TEST_TOP_PAGE);
     let normalBrowser = gBrowser.getBrowserForTab(normalTab);
@@ -199,17 +194,16 @@ function runAllTests(withStoragePrincipa
         [
           "privacy.restrict3rdpartystorage.partitionedHosts",
           "tracking.example.org,not-tracking.example.com",
         ],
         [
           "privacy.storagePrincipal.enabledForTrackers",
           storagePrincipalPrefValue,
         ],
-        ["dom.storage.next_gen", lsngEnabled],
       ],
     });
 
     await UrlClassifierTestUtils.addTestTrackers();
 
     info("Creating a non-tracker top-level context");
     let normalTab = BrowserTestUtils.addTab(gBrowser, TEST_TOP_PAGE);
     let normalBrowser = gBrowser.getBrowserForTab(normalTab);
@@ -320,17 +314,16 @@ function runAllTests(withStoragePrincipa
         [
           "privacy.restrict3rdpartystorage.partitionedHosts",
           "tracking.example.org,not-tracking.example.com",
         ],
         [
           "privacy.storagePrincipal.enabledForTrackers",
           storagePrincipalPrefValue,
         ],
-        ["dom.storage.next_gen", lsngEnabled],
       ],
     });
 
     await UrlClassifierTestUtils.addTestTrackers();
 
     info("Creating a non-tracker top-level context");
     let normalTab = BrowserTestUtils.addTab(gBrowser, TEST_TOP_PAGE);
     let normalBrowser = gBrowser.getBrowserForTab(normalTab);
@@ -428,17 +421,16 @@ function runAllTests(withStoragePrincipa
         [
           "privacy.restrict3rdpartystorage.partitionedHosts",
           "tracking.example.org,not-tracking.example.com",
         ],
         [
           "privacy.storagePrincipal.enabledForTrackers",
           storagePrincipalPrefValue,
         ],
-        ["dom.storage.next_gen", lsngEnabled],
       ],
     });
 
     await UrlClassifierTestUtils.addTestTrackers();
 
     info("Creating a non-tracker top-level context");
     let normalTab = BrowserTestUtils.addTab(gBrowser, TEST_TOP_PAGE);
     let normalBrowser = gBrowser.getBrowserForTab(normalTab);
@@ -522,17 +514,16 @@ function runAllTests(withStoragePrincipa
         [
           "privacy.restrict3rdpartystorage.partitionedHosts",
           "tracking.example.org,not-tracking.example.com",
         ],
         [
           "privacy.storagePrincipal.enabledForTrackers",
           storagePrincipalPrefValue,
         ],
-        ["dom.storage.next_gen", lsngEnabled],
       ],
     });
 
     await UrlClassifierTestUtils.addTestTrackers();
 
     info("Creating a non-tracker top-level context");
     let normalTab = BrowserTestUtils.addTab(gBrowser, TEST_TOP_PAGE);
     let normalBrowser = gBrowser.getBrowserForTab(normalTab);
@@ -613,17 +604,16 @@ function runAllTests(withStoragePrincipa
         [
           "privacy.restrict3rdpartystorage.partitionedHosts",
           "tracking.example.org,not-tracking.example.com",
         ],
         [
           "privacy.storagePrincipal.enabledForTrackers",
           storagePrincipalPrefValue,
         ],
-        ["dom.storage.next_gen", lsngEnabled],
       ],
     });
 
     await UrlClassifierTestUtils.addTestTrackers();
 
     info("Creating a non-tracker top-level context");
     let normalTab = BrowserTestUtils.addTab(gBrowser, TEST_TOP_PAGE);
     let normalBrowser = gBrowser.getBrowserForTab(normalTab);
@@ -707,17 +697,16 @@ function runAllTests(withStoragePrincipa
         [
           "privacy.restrict3rdpartystorage.partitionedHosts",
           "tracking.example.org,not-tracking.example.com",
         ],
         [
           "privacy.storagePrincipal.enabledForTrackers",
           storagePrincipalPrefValue,
         ],
-        ["dom.storage.next_gen", lsngEnabled],
       ],
     });
 
     await UrlClassifierTestUtils.addTestTrackers();
 
     info("Creating a non-tracker top-level context");
     let normalTab = BrowserTestUtils.addTab(gBrowser, TEST_TOP_PAGE);
     let normalBrowser = gBrowser.getBrowserForTab(normalTab);
@@ -791,13 +780,11 @@ function runAllTests(withStoragePrincipa
     });
   });
 }
 
 for (let pref of [
   Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER,
   Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN,
 ]) {
-  runAllTests(false, true, pref);
-  runAllTests(false, false, pref);
-  runAllTests(true, true, pref);
-  runAllTests(true, false, pref);
+  runAllTests(false, pref);
+  runAllTests(true, pref);
 }