From 9de05011011f3a3a66400308acc3faad631d0cb2 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Fri, 27 Apr 2018 16:29:55 +0200 Subject: [PATCH] Bug 1447235 - Enable the console sidebar in Nightly; r=bgrins. In Bug 1419292, we make sure there is no issue when releasing actors for the output messages, so the sidebar is probably good to go on Nighly in order to get more feedback. The test for context menu entries in the console was updated since it now shows the "Open in sidebar" entry. MozReview-Commit-ID: 8R3rhf944Fh --HG-- extra : rebase_source : e504095a1a5ffee711f81ef3de2b1a4da38b4493 --- .../client/preferences/devtools-client.js | 6 +++++- .../browser_console_context_menu_entries.js | 20 +++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/devtools/client/preferences/devtools-client.js b/devtools/client/preferences/devtools-client.js index f1addb51eb60..660cdb02f139 100644 --- a/devtools/client/preferences/devtools-client.js +++ b/devtools/client/preferences/devtools-client.js @@ -292,8 +292,12 @@ pref("devtools.webconsole.timestampMessages", false); // to automatically trigger multiline editing (equivalent to shift + enter). pref("devtools.webconsole.autoMultiline", true); -// Enable the webconsole sidebar toggle +// Enable the webconsole sidebar toggle in Nightly builds. +#if defined(NIGHTLY_BUILD) +pref("devtools.webconsole.sidebarToggle", true); +#else pref("devtools.webconsole.sidebarToggle", false); +#endif // Disable the new performance recording panel by default pref("devtools.performance.new-panel-enabled", false); diff --git a/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js b/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js index 3672a29ab66f..58c19ba7c30d 100644 --- a/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js +++ b/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js @@ -26,14 +26,14 @@ add_task(async function() { let menuPopup = await openContextMenu(hud, networkMessage.node); ok(menuPopup, "The context menu is displayed on a network message"); - let expectedContextMenu = [ + let expectedContextMenu = addPrefBasedEntries([ "#console-menu-copy-url (a)", "#console-menu-open-url (T)", "#console-menu-store (S) [disabled]", "#console-menu-copy (C)", "#console-menu-copy-object (o) [disabled]", - "#console-menu-select (A)" - ]; + "#console-menu-select (A)", + ]); is(getSimplifiedContextMenu(menuPopup).join("\n"), expectedContextMenu.join("\n"), "The context menu has the expected entries for a network message"); @@ -47,18 +47,26 @@ add_task(async function() { menuPopup = await openContextMenu(hud, logMessage.node); ok(menuPopup, "The context menu is displayed on a log message"); - expectedContextMenu = [ + expectedContextMenu = addPrefBasedEntries([ "#console-menu-store (S) [disabled]", "#console-menu-copy (C)", "#console-menu-copy-object (o) [disabled]", - "#console-menu-select (A)" - ]; + "#console-menu-select (A)", + ]); is(getSimplifiedContextMenu(menuPopup).join("\n"), expectedContextMenu.join("\n"), "The context menu has the expected entries for a simple log message"); await hideContextMenu(hud); }); +function addPrefBasedEntries(expectedEntries) { + if (Services.prefs.getBoolPref("devtools.webconsole.sidebarToggle", false)) { + expectedEntries.push("#console-menu-open-sidebar (V) [disabled]"); + } + + return expectedEntries; +} + function getSimplifiedContextMenu(popupElement) { return [...popupElement.querySelectorAll("menuitem")] .map(entry => {