Skip to content

Commit

Permalink
Bug 1782527 - [devtools] Change devtools.chrome-debug-mode default va…
Browse files Browse the repository at this point in the history
…lue to parent-process. r=jdescottes.

Differential Revision: https://phabricator.services.mozilla.com/D153432
  • Loading branch information
nchevobbe committed Aug 4, 2022
1 parent 71cb284 commit 86f24f5
Show file tree
Hide file tree
Showing 42 changed files with 62 additions and 6 deletions.
2 changes: 1 addition & 1 deletion browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -2296,7 +2296,7 @@ pref("devtools.browsertoolbox.fission", true);
// All processes, all documents, all workers, all add-ons.
// - "parent-process" will restrict debugging to the parent process
// All privileged javascript, documents and workers running in the parent process.
pref("devtools.browsertoolbox.scope", "everything");
pref("devtools.browsertoolbox.scope", "parent-process");

// This preference will enable watching top-level targets from the server side.
pref("devtools.target-switching.server.enabled", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Services.scriptloader.loadSubScript(

add_task(async function() {
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

// Make sure the toolbox opens with the webconsole initially selected.
await pushPref("devtools.browsertoolbox.panel", "webconsole");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Services.scriptloader.loadSubScript(

add_task(async function() {
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");
await pushPref("dom.serviceWorkers.enabled", true);
await pushPref("dom.serviceWorkers.testing.enabled", true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Services.scriptloader.loadSubScript(
add_task(async function testSourceTreeNamesForWebExtensions() {
await pushPref("devtools.chrome.enabled", true);
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");
const extension = await installAndStartContentScriptExtension();

const dbg = await initDebugger("doc-content-script-sources.html");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ add_task(async function runTest() {
""
);

await pushPref("devtools.browsertoolbox.scope", "everything");

const ToolboxTask = await initBrowserToolboxTask({
enableBrowserToolboxFission: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ add_task(async function() {
await pushPref("devtools.webconsole.input.context", true);
// Force EFT to have targets for all WindowGlobals
await pushPref("devtools.every-frame-target.enabled", true);
// Enable Multiprocess Browser Toolbox
await pushPref("devtools.browsertoolbox.scope", "everything");

// Open the test *before* opening the Browser toolbox in order to have the right target title.
// Once created, the target won't update its title, and so would be "New Tab", instead of "Test tab"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ requestLongerTimeout(4);
* test locally.
*/
add_task(async function() {
await pushPref("devtools.browsertoolbox.scope", "everything");
const ToolboxTask = await initBrowserToolboxTask({
enableBrowserToolboxFission: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ requestLongerTimeout(4);
add_task(async function() {
// Forces the Browser Toolbox to open on the inspector by default
await pushPref("devtools.browsertoolbox.panel", "inspector");
// Enable Multiprocess Browser Toolbox
await pushPref("devtools.browsertoolbox.scope", "everything");

const ToolboxTask = await initBrowserToolboxTask({
enableBrowserToolboxFission: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ add_task(async function() {

// Forces the Browser Toolbox to open on the inspector by default
await pushPref("devtools.browsertoolbox.panel", "inspector");
// Enable Multiprocess Browser Toolbox
await pushPref("devtools.browsertoolbox.scope", "everything");
const ToolboxTask = await initBrowserToolboxTask({
enableBrowserToolboxFission: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ add_task(async function() {
// Forces the Browser Toolbox to open on the inspector by default
await pushPref("devtools.browsertoolbox.panel", "inspector");

// Enable Multiprocess Browser Toolbox
await pushPref("devtools.browsertoolbox.scope", "everything");

// Open the tab *after* opening the Browser Toolbox in order to force creating the remote frames
// late and exercise frame target watching code.
await addTab(`data:text/html,<div id="test-div">PRINT PREVIEW TEST</div>`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ requestLongerTimeout(4);
add_task(async function() {
// Forces the Browser Toolbox to open on the inspector by default
await pushPref("devtools.browsertoolbox.panel", "inspector");
// Enable Multiprocess Browser Toolbox
await pushPref("devtools.browsertoolbox.scope", "everything");

const ToolboxTask = await initBrowserToolboxTask({
enableBrowserToolboxFission: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ requestLongerTimeout(4);
add_task(async function() {
// Forces the Browser Toolbox to open on the inspector by default
await pushPref("devtools.browsertoolbox.panel", "inspector");
await pushPref("devtools.browsertoolbox.scope", "everything");

const tab = await addTab(
"https://example.com/document-builder.sjs?html=<div id=pick-me>Pickme"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ add_task(async function() {
"devtools.browsertoolbox.fission",
false
);
await pushPref("devtools.browsertoolbox.scope", "everything");

const topWindow = Services.wm.getMostRecentWindow("navigator:browser");
is(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ add_task(async function() {
await SpecialPowers.pushPrefEnv({
set: [["devtools.browsertoolbox.fission", true]],
});
await SpecialPowers.pushPrefEnv({
set: [["devtools.browsertoolbox.scope", "everything"]],
});

const tab = await addTab(TEST_URL);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Services.scriptloader.loadSubScript(

add_task(async function() {
await addTab(TEST_URI);
await pushPref("devtools.browsertoolbox.scope", "everything");
const ToolboxTask = await initBrowserToolboxTask({
enableBrowserToolboxFission: true,
});
Expand Down
1 change: 1 addition & 0 deletions devtools/client/webconsole/test/browser/browser_console.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ add_task(async function() {
info(
"Check browser console messages with devtools.browsertoolbox.fission set to true"
);
await pushPref("devtools.browsertoolbox.scope", "everything");
await pushPref("devtools.browsertoolbox.fission", true);
await testMessages();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const TEST_URI =
add_task(async function() {
await pushPref("devtools.browserconsole.contentMessages", true);
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

await addTab(TEST_URI);
let hud = await BrowserConsoleManager.toggleBrowserConsole();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ add_task(async function() {
await pushPref("devtools.browserconsole.contentMessages", true);
// Enable Fission browser console to see the logged content object
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

// Disable the preloaded process as it creates processes intermittently
// which forces the emission of RDP requests we aren't correctly waiting for.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ add_task(async function() {
await pushPref("devtools.browserconsole.contentMessages", true);
// Enable Fission browser console to see the logged content object
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

await addTab(TEST_URI);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ add_task(async function() {
await pushPref("devtools.browserconsole.contentMessages", true);
// Enable Fission browser console to see the logged content object
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

await addTab(TEST_URI);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ add_task(async function() {
await pushPref("devtools.browserconsole.contentMessages", true);
// Enable Fission browser console to see the logged content object
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

await addTab(TEST_URI);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ add_task(async function() {
await pushPref("devtools.browserconsole.contentMessages", true);
// Enable Fission browser console to see the logged content object
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

await addTab(TEST_URI);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ add_task(async function() {
await pushPref("devtools.browserconsole.contentMessages", true);
// Enable Fission browser console to see the logged content object
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

await addTab(TEST_URI);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const TEST_URI =

add_task(async function() {
await pushPref("devtools.browserconsole.contentMessages", true);
await pushPref("devtools.browsertoolbox.scope", "everything");
// Enable net messages in the console for this test.
await pushPref("devtools.browserconsole.filter.net", true);
// This is required for testing the text input in the browser console:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ add_task(async function() {
await pushPref("devtools.browserconsole.contentMessages", true);
// Enable Fission browser console to see the logged content object
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

await addTab(TEST_URI);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ add_task(async function() {
// which forces the emission of RDP requests we aren't correctly waiting for.
await pushPref("dom.ipc.processPrelaunch.enabled", false);

const isFissionEnabledForBrowserConsole = Services.prefs.getBoolPref(
"devtools.browsertoolbox.fission",
false
);
if (isFissionEnabledForBrowserConsole) {
await pushPref("devtools.browsertoolbox.scope", "everything");
}

const wcHud = await openNewTabAndConsole(TEST_URI);
ok(wcHud, "web console opened");

Expand Down Expand Up @@ -57,11 +65,6 @@ add_task(async function() {
ok(url.includes("toolbox.js"), "we have the expected view source URL");
ok(!url.includes("->"), "no -> in the URL given to view-source");

const isFissionEnabledForBrowserConsole = Services.prefs.getBoolPref(
"devtools.browsertoolbox.fission",
false
);

const { targetCommand } = bcHud.commands;
// If Fission is not enabled for the Browser Console (e.g. in Beta at this moment),
// the target list won't watch for Frame targets, and as a result we won't have issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ add_task(async function() {
await pushPref("dom.ipc.processPrelaunch.enabled", false);

await pushPref("devtools.browserconsole.contentMessages", true);
await pushPref("devtools.browsertoolbox.scope", "everything");
await addTab(TEST_URI);

const hud = await BrowserConsoleManager.toggleBrowserConsole();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ add_task(async function() {
await pushPref("devtools.chrome.enabled", true);
await pushPref("devtools.every-frame-target.enabled", true);
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

const hud = await BrowserConsoleManager.toggleBrowserConsole();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ add_task(async function() {
// Show the content messages
await pushPref("devtools.browserconsole.contentMessages", true);
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

info("Open the Browser Console");
const hud = await BrowserConsoleManager.toggleBrowserConsole();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ add_task(async function() {
await pushPref("devtools.browserconsole.contentMessages", true);
// Enable Fission browser console to see the logged content object
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");
hud = await BrowserConsoleManager.toggleBrowserConsole();
ok(hud, "browser console opened");
await testMessages(hud);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ add_task(async function() {
await testBrowserConsole(publicTab);

await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");
await testBrowserConsole(publicTab);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const TEST_URI =

add_task(async function() {
await pushPref("devtools.browserconsole.contentMessages", true);
await pushPref("devtools.browsertoolbox.scope", "everything");
await addTab(TEST_URI);

info("Check with devtools.browsertoolbox.fission set to false");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ add_task(async function() {
await pushPref("devtools.webconsole.input.editor", true);
await pushPref("devtools.browserconsole.input.editor", true);

// Enable Multiprocess Browser Console
await pushPref("devtools.browsertoolbox.scope", "everything");

// Needed for the execute() function below
await pushPref("security.allow_parent_unrestricted_js_loads", true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const TEST_URL = URL_ROOT_SSL + "early_console_document.html";
add_task(async function() {
// Enable Multiprocess Browser Toolbox (it's still disabled for non-Nightly builds).
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

const {
client,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ add_task(async function() {
// devtools.browsertoolbox.fission should be true to monitor resources from
// remote browsers & frames.
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

// Open a test tab
const tab = await addTab("data:text/html,Root Node tests");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ async function testIframeNavigations() {
1,
"Without fission/EFT, there is only the top level target"
);
await commands.destroy();
return;
}
is(targets.length, 2, "retrieved the top level and the iframe targets");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const SERVICE_WORKER_URL = URL_ROOT_SSL + "test_service_worker.js";
add_task(async function() {
// Enabled fission's pref as the TargetCommand is almost disabled without it
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");

// Disable the preloaded process as it creates processes intermittently
// which forces the emission of RDP requests we aren't correctly waiting for.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ add_task(async function() {

// Enabled fission prefs
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");
// Disable the preloaded process as it gets created lazily and may interfere
// with process count assertions
await pushPref("dom.ipc.processPrelaunch.enabled", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const TEST_URL =
add_task(async function() {
// Enabled fission's pref as the TargetCommand is almost disabled without it
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");
// Disable the preloaded process as it gets created lazily and may interfere
// with process count assertions
await pushPref("dom.ipc.processPrelaunch.enabled", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,7 @@ add_task(async function() {
iframeWorkerTargetAfterGoingBack,
"The target list handled the worker created in the iframe from the BF Cache"
);

targetCommand.destroy();
await commands.destroy();
});
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const CHROME_WORKER_URL = CHROME_URL_ROOT + "test_worker.js";
add_task(async function() {
// Enabled fission prefs
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");
// Disable the preloaded process as it gets created lazily and may interfere
// with process count assertions
await pushPref("dom.ipc.processPrelaunch.enabled", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const TEST_URL =
add_task(async function() {
// Enabled fission's pref as the TargetCommand is almost disabled without it
await pushPref("devtools.browsertoolbox.fission", true);
await pushPref("devtools.browsertoolbox.scope", "everything");
// Disable the preloaded process as it gets created lazily and may interfere
// with process count assertions
await pushPref("dom.ipc.processPrelaunch.enabled", false);
Expand Down

0 comments on commit 86f24f5

Please sign in to comment.