Bug 1596834 - Use forceNewProcess in browser_permmgr_sync.js. r=mconley
authorAndrew McCreight <continuation@gmail.com>
Fri, 15 Nov 2019 17:24:11 +0000
changeset 502246 4177c6123ddb391dc50894ddecb6d244b4f0bfd0
parent 502245 c06659c20d415adb089a7751af744d8f4a908153
child 502247 493025785e6adfde44b1e2ad0a00b48b3ff4cb7b
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1596834
milestone72.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 1596834 - Use forceNewProcess in browser_permmgr_sync.js. r=mconley Also fix a few typos in comments. Differential Revision: https://phabricator.services.mozilla.com/D53229
extensions/permissions/test/browser_permmgr_sync.js
--- a/extensions/permissions/test/browser_permmgr_sync.js
+++ b/extensions/permissions/test/browser_permmgr_sync.js
@@ -6,54 +6,29 @@ function addPerm(aOrigin, aName) {
     principal,
     aName,
     Services.perms.ALLOW_ACTION
   );
 }
 
 add_task(async function() {
   // Make sure that we get a new process for the tab which we create. This is
-  // important, becuase we wanto to assert information about the initial state
+  // important, because we want to assert information about the initial state
   // of the local permissions cache.
-  //
-  // We use the same approach here as was used in the e10s-multi localStorage
-  // tests (dom/tests/browser/browser_localStorage_e10s.js (bug )). This ensures
-  // that our tab has its own process.
-  //
-  // Bug 1345990 tracks implementing a better tool for ensuring this.
-  let keepAliveCount = 0;
-  try {
-    keepAliveCount = SpecialPowers.getIntPref("dom.ipc.keepProcessesAlive.web");
-  } catch (ex) {
-    // Then zero is correct.
-  }
-  let safeProcessCount = keepAliveCount + 2;
-  info(
-    "dom.ipc.keepProcessesAlive.web is " +
-      keepAliveCount +
-      ", boosting " +
-      "process count temporarily to " +
-      safeProcessCount
-  );
-  await SpecialPowers.pushPrefEnv({
-    set: [
-      ["dom.ipc.processCount", safeProcessCount],
-      ["dom.ipc.processCount.web", safeProcessCount],
-    ],
-  });
 
   addPerm("http://example.com", "perm1");
   addPerm("http://foo.bar.example.com", "perm2");
   addPerm("about:home", "perm3");
   addPerm("https://example.com", "perm4");
-  // NOTE: This permission is a preload permission, so it should be avaliable in the content process from startup.
+  // NOTE: This permission is a preload permission, so it should be available in
+  // the content process from startup.
   addPerm("https://somerandomwebsite.com", "document");
 
   await BrowserTestUtils.withNewTab(
-    { gBrowser, url: "about:blank" },
+    { gBrowser, url: "about:blank", forceNewProcess: true },
     async function(aBrowser) {
       await ContentTask.spawn(aBrowser, null, async function() {
         // Before the load http URIs shouldn't have been sent down yet
         is(
           Services.perms.testPermissionFromPrincipal(
             Services.scriptSecurityManager.createContentPrincipalFromOrigin(
               "http://example.com"
             ),
@@ -166,17 +141,17 @@ add_task(async function() {
 
       addPerm("http://example.com", "newperm1");
       addPerm("http://foo.bar.example.com", "newperm2");
       addPerm("about:home", "newperm3");
       addPerm("https://example.com", "newperm4");
       addPerm("https://someotherrandomwebsite.com", "document");
 
       await ContentTask.spawn(aBrowser, null, async function() {
-        // The new permissions should be avaliable, but only for
+        // The new permissions should be available, but only for
         // http://example.com, and about:home
         is(
           Services.perms.testPermissionFromPrincipal(
             Services.scriptSecurityManager.createContentPrincipalFromOrigin(
               "http://example.com"
             ),
             "perm1"
           ),
@@ -278,17 +253,17 @@ add_task(async function() {
         await new Promise(resolve => {
           let iframe = content.document.createElement("iframe");
           iframe.setAttribute("src", "https://sub1.test1.example.com");
           iframe.onload = resolve;
           content.document.body.appendChild(iframe);
         });
 
         // Now that the https subdomain has loaded, we want to make sure that the
-        // permissions are also avaliable for its parent domain, https://example.com!
+        // permissions are also available for its parent domain, https://example.com!
         is(
           Services.perms.testPermissionFromPrincipal(
             Services.scriptSecurityManager.createContentPrincipalFromOrigin(
               "http://example.com"
             ),
             "perm1"
           ),
           Services.perms.ALLOW_ACTION,