Commit 4f8277ed authored by Daniel Varga's avatar Daniel Varga
Browse files

Merge mozilla-central to autoland. a=merge

parents 7fc7f149 26f16f3b
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const DEFAULT_PROCESS_COUNT = Services.prefs.getDefaultBranch(null).getIntPref("dom.ipc.processCount");
/**
* A test that checks whether any preference getter from the given list
* of stats was called more often than the max parameter.
......@@ -122,10 +120,7 @@ add_task(async function startup() {
// This opens 10 tabs and checks pref getters.
add_task(async function open_10_tabs() {
// This is somewhat arbitrary. When we had a default of 4 content processes
// the value was 15. We need to scale it as we increase the number of
// content processes so we approximate with 4 * process_count.
const max = 4 * DEFAULT_PROCESS_COUNT;
let max = 15;
let whitelist = {
"layout.css.dpi": {
......@@ -151,6 +146,10 @@ add_task(async function open_10_tabs() {
min: 10,
max: 18,
},
"dom.ipc.processCount": {
min: 10,
max: 15,
},
"browser.startup.record": {
max: 20,
},
......
......@@ -2,8 +2,6 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
const DEFAULT_PROCESS_COUNT = Services.prefs.getDefaultBranch(null).getIntPref("dom.ipc.processCount");
add_task(async function test_slow_content_script() {
// Make sure we get a new process for our tab, or our reportProcessHangs
// preferences value won't apply to it.
......@@ -17,7 +15,7 @@ add_task(async function test_slow_content_script() {
await SpecialPowers.pushPrefEnv({
set: [
["dom.ipc.processCount", DEFAULT_PROCESS_COUNT * 2],
["dom.ipc.processCount", 8],
["dom.ipc.processPrelaunch.enabled", false],
["dom.ipc.reportProcessHangs", true],
],
......
......@@ -613,7 +613,6 @@
<menuitem label="5" value="5"/>
<menuitem label="6" value="6"/>
<menuitem label="7" value="7"/>
<menuitem label="8" value="8"/>
</menupopup>
</menulist>
</hbox>
......
......@@ -44,9 +44,7 @@ add_task(async function testPrefsAreDefault() {
});
add_task(async function testPrefsSetByUser() {
const kNewCount = DEFAULT_PROCESS_COUNT - 2;
Services.prefs.setIntPref("dom.ipc.processCount", kNewCount);
Services.prefs.setIntPref("dom.ipc.processCount", DEFAULT_PROCESS_COUNT + 2);
Services.prefs.setBoolPref("browser.preferences.defaultPerformanceSettings.enabled", false);
let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
......@@ -58,8 +56,8 @@ add_task(async function testPrefsSetByUser() {
let contentProcessCount = doc.querySelector("#contentProcessCount");
is(contentProcessCount.disabled, false, "process count control should be enabled");
is(Services.prefs.getIntPref("dom.ipc.processCount"), kNewCount, "process count should be the set value");
is(contentProcessCount.selectedItem.value, kNewCount, "selected item should be the set one");
is(Services.prefs.getIntPref("dom.ipc.processCount"), DEFAULT_PROCESS_COUNT + 2, "process count should be the set value");
is(contentProcessCount.selectedItem.value, DEFAULT_PROCESS_COUNT + 2, "selected item should be the set one");
let useRecommendedPerformanceSettings = doc.querySelector("#useRecommendedPerformanceSettings");
useRecommendedPerformanceSettings.click();
......
......@@ -5,11 +5,14 @@ const CONTENT_CREATED = "ipc:content-created";
// Make sure that BTU.withNewTab({ ..., forceNewProcess: true }) loads
// new tabs in their own process.
async function spawnNewAndTest(recur, pids) {
let processCreated = TestUtils.topicObserved(CONTENT_CREATED);
await BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank", forceNewProcess: true },
async function(browser) {
// Make sure our new browser is in its own process.
// Make sure our new browser is in its own process. The processCreated
// promise should have already resolved by this point.
await processCreated;
let newPid = browser.frameLoader.tabParent.osPid;
ok(!pids.has(newPid), "new tab is in its own process: " + recur);
ok(!pids.has(newPid), "new tab is in its own process");
pids.add(newPid);
if (recur) {
......
......@@ -3284,11 +3284,7 @@ pref("dom.ipc.plugins.asyncdrawing.enabled", true);
pref("dom.ipc.plugins.forcedirect.enabled", true);
// Enable multi by default.
#if defined(NIGHTLY_BUILD)
pref("dom.ipc.processCount", 8);
#else
pref("dom.ipc.processCount", 4);
#endif
// Default to allow only one file:// URL content process.
pref("dom.ipc.processCount.file", 1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment