Bug 966692 - Reduce the default set of warnings we display in console; r=msucan
authorRob Campbell <rcampbell@mozilla.com>
Thu, 20 Feb 2014 16:16:00 -0500
changeset 171779 b76d4126d9fe8bb2b7c476d89b8a71433435f1bd
parent 171778 8859e1b0add3e044b7eefd1f64d167a52e28d0fd
child 171780 1de38e0fbbb68ab09504b398e99b2730a2aa8af7
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersmsucan
bugs966692
milestone30.0a1
Bug 966692 - Reduce the default set of warnings we display in console; r=msucan
browser/app/profile/firefox.js
browser/devtools/webconsole/test/browser_bug_638949_copy_link_location.js
browser/devtools/webconsole/test/browser_webconsole_bug_632817.js
browser/devtools/webconsole/test/browser_webconsole_bug_764572_output_open_url.js
browser/devtools/webconsole/test/browser_webconsole_dont_navigate_on_doubleclick.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1202,23 +1202,23 @@ pref("devtools.theme", "dark");
 // Display the introductory text
 pref("devtools.gcli.hideIntro", false);
 
 // How eager are we to show help: never=1, sometimes=2, always=3
 pref("devtools.gcli.eagerHelper", 2);
 
 // Remember the Web Console filters
 pref("devtools.webconsole.filter.network", true);
-pref("devtools.webconsole.filter.networkinfo", true);
+pref("devtools.webconsole.filter.networkinfo", false);
 pref("devtools.webconsole.filter.netwarn", true);
 pref("devtools.webconsole.filter.csserror", true);
 pref("devtools.webconsole.filter.cssparser", false);
 pref("devtools.webconsole.filter.csslog", false);
 pref("devtools.webconsole.filter.exception", true);
-pref("devtools.webconsole.filter.jswarn", true);
+pref("devtools.webconsole.filter.jswarn", false);
 pref("devtools.webconsole.filter.jslog", true);
 pref("devtools.webconsole.filter.error", true);
 pref("devtools.webconsole.filter.warn", true);
 pref("devtools.webconsole.filter.info", true);
 pref("devtools.webconsole.filter.log", true);
 pref("devtools.webconsole.filter.secerror", true);
 pref("devtools.webconsole.filter.secwarn", true);
 
--- a/browser/devtools/webconsole/test/browser_bug_638949_copy_link_location.js
+++ b/browser/devtools/webconsole/test/browser_bug_638949_copy_link_location.js
@@ -8,20 +8,24 @@ const TEST_URI = "http://example.com/bro
 const COMMAND_NAME = "consoleCmd_copyURL";
 const CONTEXT_MENU_ID = "#menu_copyURL";
 
 let HUD = null;
 let output = null;
 let menu = null;
 
 function test() {
+  let originalNetPref = Services.prefs.getBoolPref("devtools.webconsole.filter.networkinfo");
   registerCleanupFunction(() => {
+    Services.prefs.setBoolPref("devtools.webconsole.filter.networkinfo", originalNetPref);
     HUD = output = menu = null;
   });
 
+  Services.prefs.setBoolPref("devtools.webconsole.filter.networkinfo", true);
+
   addTab(TEST_URI);
   browser.addEventListener("load", function onLoad() {
     browser.removeEventListener("load", onLoad, true);
 
     openConsole(null, function (aHud) {
       HUD = aHud;
       output = aHud.outputNode;
       menu = HUD.iframeWindow.document.getElementById("output-contextmenu");
--- a/browser/devtools/webconsole/test/browser_webconsole_bug_632817.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_bug_632817.js
@@ -12,18 +12,23 @@ const TEST_DATA_JSON_CONTENT =
   '{ id: "test JSON data", myArray: [ "foo", "bar", "baz", "biff" ] }';
 
 let lastRequest = null;
 let requestCallback = null;
 
 function test()
 {
   const PREF = "devtools.webconsole.persistlog";
+  let original = Services.prefs.getBoolPref("devtools.webconsole.filter.networkinfo");
+  Services.prefs.setBoolPref("devtools.webconsole.filter.networkinfo", true);
   Services.prefs.setBoolPref(PREF, true);
-  registerCleanupFunction(() => Services.prefs.clearUserPref(PREF));
+  registerCleanupFunction(() => {
+    Services.prefs.setBoolPref("devtools.webconsole.filter.networkinfo", original);
+    Services.prefs.clearUserPref(PREF);
+  });
 
   addTab("data:text/html;charset=utf-8,Web Console network logging tests");
 
   browser.addEventListener("load", function onLoad() {
     browser.removeEventListener("load", onLoad, true);
 
     openConsole(null, function(aHud) {
       hud = aHud;
--- a/browser/devtools/webconsole/test/browser_webconsole_bug_764572_output_open_url.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_bug_764572_output_open_url.js
@@ -6,16 +6,21 @@
 // that is shown for network requests
 const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html"
 const COMMAND_NAME = "consoleCmd_openURL";
 const CONTEXT_MENU_ID = "#menu_openURL";
 
 let HUD = null, outputNode = null, contextMenu = null;
 
 function test() {
+  let original = Services.prefs.getBoolPref("devtools.webconsole.filter.networkinfo");
+  Services.prefs.setBoolPref("devtools.webconsole.filter.networkinfo", true);
+  registerCleanupFunction(() => {
+    Services.prefs.setBoolPref("devtools.webconsole.filter.networkinfo", original);
+  });
   addTab(TEST_URI);
   browser.addEventListener("load", function onLoad() {
     browser.removeEventListener("load", onLoad, true);
     openConsole(null, consoleOpened);
   }, true);
 }
 
 function consoleOpened(aHud) {
--- a/browser/devtools/webconsole/test/browser_webconsole_dont_navigate_on_doubleclick.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_dont_navigate_on_doubleclick.js
@@ -1,16 +1,21 @@
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests that if a link in console is double clicked, the console frame doesn't
 // navigate to that destination (bug 975707).
 
 function test() {
+  let originalNetPref = Services.prefs.getBoolPref("devtools.webconsole.filter.networkinfo");
+  registerCleanupFunction(() => {
+    Services.prefs.setBoolPref("devtools.webconsole.filter.networkinfo", originalNetPref);
+  });
+  Services.prefs.setBoolPref("devtools.webconsole.filter.networkinfo", true);
   Task.spawn(runner).then(finishTest);
 
   function* runner() {
     const TEST_PAGE_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html" + "?_uniq=" + Date.now();
 
     const {tab} = yield loadTab("data:text/html;charset=utf8,<p>hello</p>");
     const hud = yield openConsole(tab);