From c9c241c31257ef97e5029e70965595064de7ad0b Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Sat, 28 Sep 2019 21:09:17 +0000 Subject: [PATCH] Bug 764545 - WebConsole default position should be "below"; r=msucan UltraBlame original commit: afc76272017b8852d9d9eb2a9a609c63c77a7e27 --- browser/app/profile/firefox.js | 2 +- ...owser_webconsole_bug_618311_close_panels.js | 8 ++++++-- ...r_webconsole_bug_618311_private_browsing.js | 8 ++++++-- .../test/browser_webconsole_position_ui.js | 18 +++++++++--------- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index de85e48c53c1..7e97d9eed219 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1098,7 +1098,7 @@ pref("devtools.hud.height", 0); -pref("devtools.webconsole.position", "above"); +pref("devtools.webconsole.position", "below"); pref("devtools.webconsole.filter.network", true); diff --git a/browser/devtools/webconsole/test/browser_webconsole_bug_618311_close_panels.js b/browser/devtools/webconsole/test/browser_webconsole_bug_618311_close_panels.js index 6fd5f0511f91..3f995646c034 100644 --- a/browser/devtools/webconsole/test/browser_webconsole_bug_618311_close_panels.js +++ b/browser/devtools/webconsole/test/browser_webconsole_bug_618311_close_panels.js @@ -99,8 +99,12 @@ function performTest() { successFn: function() { let jstermMessage = HUD.outputNode.querySelector(".webconsole-msg-output"); - EventUtils.synthesizeMouse(jstermMessage, 2, 2, {}); - EventUtils.synthesizeMouse(networkLink, 2, 2, {}); + EventUtils.sendMouseEvent({ type: "mousedown" }, jstermMessage); + EventUtils.sendMouseEvent({ type: "mouseup" }, jstermMessage); + EventUtils.sendMouseEvent({ type: "click" }, jstermMessage); + EventUtils.sendMouseEvent({ type: "mousedown" }, networkLink); + EventUtils.sendMouseEvent({ type: "mouseup" }, networkLink); + EventUtils.sendMouseEvent({ type: "click" }, networkLink); }, failureFn: finishTest, }); diff --git a/browser/devtools/webconsole/test/browser_webconsole_bug_618311_private_browsing.js b/browser/devtools/webconsole/test/browser_webconsole_bug_618311_private_browsing.js index 20bd5c234700..a9afacd6f4d0 100644 --- a/browser/devtools/webconsole/test/browser_webconsole_bug_618311_private_browsing.js +++ b/browser/devtools/webconsole/test/browser_webconsole_bug_618311_private_browsing.js @@ -124,8 +124,12 @@ function performTest() { successFn: function() { let jstermMessage = HUD.outputNode.querySelector(".webconsole-msg-output"); - EventUtils.synthesizeMouse(jstermMessage, 2, 2, {}); - EventUtils.synthesizeMouse(networkLink, 2, 2, {}); + EventUtils.sendMouseEvent({ type: "mousedown" }, jstermMessage); + EventUtils.sendMouseEvent({ type: "mouseup" }, jstermMessage); + EventUtils.sendMouseEvent({ type: "click" }, jstermMessage); + EventUtils.sendMouseEvent({ type: "mousedown" }, networkLink); + EventUtils.sendMouseEvent({ type: "mouseup" }, networkLink); + EventUtils.sendMouseEvent({ type: "click" }, networkLink); }, failureFn: finishTest, }); diff --git a/browser/devtools/webconsole/test/browser_webconsole_position_ui.js b/browser/devtools/webconsole/test/browser_webconsole_position_ui.js index 232f2f47d706..7e8c38001959 100644 --- a/browser/devtools/webconsole/test/browser_webconsole_position_ui.js +++ b/browser/devtools/webconsole/test/browser_webconsole_position_ui.js @@ -35,21 +35,21 @@ function onLoad() { let hudRef = HUDService.hudReferences[hudId]; let hudBox = hudRef.HUDBox; - is(hudBox.parentNode.childNodes[0].getAttribute("id"), hudId, + is(hudBox.parentNode.childNodes[2].getAttribute("id"), hudId, "initial console position is correct"); - is(hudRef.positionMenuitems.above.getAttribute("checked"), "true", - "position menu checkbox is above"); - is(Services.prefs.getCharPref(POSITION_PREF), "above", "pref is above"); - - hudRef.positionConsole("below"); - let id = hudBox.parentNode.childNodes[2].getAttribute("id"); - is(id, hudId, "below position is correct"); - is(hudRef.positionMenuitems.below.getAttribute("checked"), "true", "position menu checkbox is below"); is(Services.prefs.getCharPref(POSITION_PREF), "below", "pref is below"); + hudRef.positionConsole("above"); + let id = hudBox.parentNode.childNodes[0].getAttribute("id"); + is(id, hudId, "above position is correct"); + + is(hudRef.positionMenuitems.above.getAttribute("checked"), "true", + "position menu checkbox is above"); + is(Services.prefs.getCharPref(POSITION_PREF), "above", "pref is above"); + document.addEventListener("popupshown", function popupShown() { document.removeEventListener("popupshown", popupShown, false);