Bug 1447235 - Enable the console sidebar in Nightly; r=bgrins.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Fri, 27 Apr 2018 16:29:55 +0200
changeset 418722 ad016230e0bdb2e6b069387abac1b3be5fcb1459
parent 418721 ed45b1e16efffebbd249784760b76b864847e1d5
child 418723 7cb5b98fa05a94e63e7de941603d05db36257781
push id64123
push usernchevobbe@mozilla.com
push dateThu, 17 May 2018 16:17:29 +0000
treeherderautoland@ad016230e0bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1447235, 1419292
milestone62.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 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
devtools/client/preferences/devtools-client.js
devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js
--- a/devtools/client/preferences/devtools-client.js
+++ b/devtools/client/preferences/devtools-client.js
@@ -287,18 +287,22 @@ pref("devtools.netmonitor.persistlog", f
 // in the Web Console to display a timestamp, or |false| to not display
 // any timestamps.
 pref("devtools.webconsole.timestampMessages", false);
 
 // Web Console automatic multiline mode: |true| if you want incomplete statements
 // 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);
 
 // Enable client-side mapping service for source maps
 pref("devtools.source-map.client-service.enabled", true);
 
 // The number of lines that are displayed in the web console.
--- a/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js
+++ b/devtools/client/webconsole/test/mochitest/browser_console_context_menu_entries.js
@@ -21,49 +21,57 @@ add_task(async function() {
     content.wrappedJSObject.location.reload();
   });
   const networkMessage = await onNetworkMessage;
 
   info("Open and check the context menu for the network message");
   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");
 
   info("Logging a text message in the content window");
   const onLogMessage = waitForMessage(hud, "simple text message");
   ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
     content.wrappedJSObject.console.log("simple text message");
   });
 
   const logMessage = await onLogMessage;
   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 => {
       const key = entry.getAttribute("accesskey");
       const disabled = entry.hasAttribute("disabled");
       return `#${entry.id} (${key})${disabled ? " [disabled]" : ""}`;
     });
 }