Backed out changeset c6564e0c0491 (bug 1260552)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 17 Sep 2016 20:07:53 +0200
changeset 314260 8dc7461d078ee8681c0a751ea02a69611fff1954
parent 314259 17242152a8fbe65f20b864bd5a577b0dff624857
child 314261 65f32c651eb766d3e6be7e55aafe42c2f8a47305
push id30716
push userarchaeopteryx@coole-files.de
push dateSat, 17 Sep 2016 18:09:28 +0000
treeherdermozilla-central@8d211b6a94f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1260552
milestone51.0a1
backs outc6564e0c04919ae61b11db49ed717d2f19f345fd
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
Backed out changeset c6564e0c0491 (bug 1260552) MozReview-Commit-ID: LTRcVPywpho
devtools/client/framework/test/browser_toolbox_textbox_context_menu.js
devtools/client/framework/test/shared-head.js
devtools/client/inspector/computed/test/browser_computed_search-filter_context-menu.js
devtools/client/inspector/rules/test/browser_rules_eyedropper.js
devtools/client/inspector/rules/test/browser_rules_filtereditor-appears-on-swatch-click.js
devtools/client/inspector/rules/test/browser_rules_search-filter_context-menu.js
devtools/client/inspector/test/browser.ini
devtools/client/inspector/test/browser_inspector_pane-toggle-04.js
devtools/client/inspector/test/browser_inspector_search-filter_context-menu.js
--- a/devtools/client/framework/test/browser_toolbox_textbox_context_menu.js
+++ b/devtools/client/framework/test/browser_toolbox_textbox_context_menu.js
@@ -4,26 +4,24 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const URL = "data:text/html;charset=utf8,test for textbox context menu";
 
 add_task(function* () {
   let toolbox = yield openNewTabAndToolbox(URL, "inspector");
   let textboxContextMenu = toolbox.textboxContextMenuPopup;
 
-  emptyClipboard();
-
   // Make sure the focus is predictable.
   let inspector = toolbox.getPanel("inspector");
-  let onFocus = once(inspector.searchBox, "focus");
   inspector.searchBox.focus();
-  yield onFocus;
 
   ok(textboxContextMenu, "The textbox context menu is loaded in the toolbox");
 
+  emptyClipboard();
+
   let cmdUndo = textboxContextMenu.querySelector("[command=cmd_undo]");
   let cmdDelete = textboxContextMenu.querySelector("[command=cmd_delete]");
   let cmdSelectAll = textboxContextMenu.querySelector("[command=cmd_selectAll]");
   let cmdCut = textboxContextMenu.querySelector("[command=cmd_cut]");
   let cmdCopy = textboxContextMenu.querySelector("[command=cmd_copy]");
   let cmdPaste = textboxContextMenu.querySelector("[command=cmd_paste]");
 
   info("Opening context menu");
@@ -32,20 +30,17 @@ add_task(function* () {
   textboxContextMenu.openPopupAtScreen(0, 0, true);
   yield onContextMenuPopup;
 
   is(cmdUndo.getAttribute("disabled"), "true", "cmdUndo is disabled");
   is(cmdDelete.getAttribute("disabled"), "true", "cmdDelete is disabled");
   is(cmdSelectAll.getAttribute("disabled"), "true", "cmdSelectAll is disabled");
   is(cmdCut.getAttribute("disabled"), "true", "cmdCut is disabled");
   is(cmdCopy.getAttribute("disabled"), "true", "cmdCopy is disabled");
-  if (isWindows()) {
-    // emptyClipboard only works on Windows (666254), assert paste only for this OS.
-    is(cmdPaste.getAttribute("disabled"), "true", "cmdPaste is disabled");
-  }
+  is(cmdPaste.getAttribute("disabled"), "true", "cmdPaste is disabled");
 
   yield cleanup(toolbox);
 });
 
 function* cleanup(toolbox) {
   yield toolbox.destroy();
   gBrowser.removeCurrentTab();
 }
--- a/devtools/client/framework/test/shared-head.js
+++ b/devtools/client/framework/test/shared-head.js
@@ -556,23 +556,15 @@ function stopRecordingTelemetryLogs(Tele
   Telemetry.prototype.log = Telemetry.prototype._oldlog;
   Telemetry.prototype.logKeyed = Telemetry.prototype._oldlogKeyed;
   delete Telemetry.prototype._oldlog;
   delete Telemetry.prototype._oldlogKeyed;
   delete Telemetry.prototype.telemetryInfo;
 }
 
 /**
- * Clean the logical clipboard content. This method only clears the OS clipboard on
- * Windows (see Bug 666254).
+ * Clean the OS clipboard content.
  */
 function emptyClipboard() {
   let clipboard = Cc["@mozilla.org/widget/clipboard;1"]
     .getService(SpecialPowers.Ci.nsIClipboard);
-  clipboard.emptyClipboard(clipboard.kGlobalClipboard);
+  clipboard.emptyClipboard(1);
 }
-
-/**
- * Check if the current operating system is Windows.
- */
-function isWindows() {
-  return Services.appinfo.OS === "WINNT";
-}
--- a/devtools/client/inspector/computed/test/browser_computed_search-filter_context-menu.js
+++ b/devtools/client/inspector/computed/test/browser_computed_search-filter_context-menu.js
@@ -24,37 +24,27 @@ add_task(function* () {
   let cmdUndo = searchContextMenu.querySelector("[command=cmd_undo]");
   let cmdDelete = searchContextMenu.querySelector("[command=cmd_delete]");
   let cmdSelectAll = searchContextMenu.querySelector("[command=cmd_selectAll]");
   let cmdCut = searchContextMenu.querySelector("[command=cmd_cut]");
   let cmdCopy = searchContextMenu.querySelector("[command=cmd_copy]");
   let cmdPaste = searchContextMenu.querySelector("[command=cmd_paste]");
 
   info("Opening context menu");
-
-  emptyClipboard();
-
-  let onFocus = once(searchField, "focus");
-  searchField.focus();
-  yield onFocus;
-
   let onContextMenuPopup = once(searchContextMenu, "popupshowing");
   EventUtils.synthesizeMouse(searchField, 2, 2,
     {type: "contextmenu", button: 2}, win);
   yield onContextMenuPopup;
 
   is(cmdUndo.getAttribute("disabled"), "true", "cmdUndo is disabled");
   is(cmdDelete.getAttribute("disabled"), "true", "cmdDelete is disabled");
-  is(cmdSelectAll.getAttribute("disabled"), "true", "cmdSelectAll is disabled");
+  is(cmdSelectAll.getAttribute("disabled"), "", "cmdSelectAll is enabled");
   is(cmdCut.getAttribute("disabled"), "true", "cmdCut is disabled");
   is(cmdCopy.getAttribute("disabled"), "true", "cmdCopy is disabled");
-  if (isWindows()) {
-    // emptyClipboard only works on Windows (666254), assert paste only for this OS.
-    is(cmdPaste.getAttribute("disabled"), "true", "cmdPaste is disabled");
-  }
+  is(cmdPaste.getAttribute("disabled"), "true", "cmdPaste is disabled");
 
   info("Closing context menu");
   let onContextMenuHidden = once(searchContextMenu, "popuphidden");
   searchContextMenu.hidePopup();
   yield onContextMenuHidden;
 
   info("Copy text in search field using the context menu");
   searchField.value = TEST_INPUT;
--- a/devtools/client/inspector/rules/test/browser_rules_eyedropper.js
+++ b/devtools/client/inspector/rules/test/browser_rules_eyedropper.js
@@ -59,18 +59,16 @@ add_task(function* () {
 
   info("Test that a color can be selected with the eyedropper");
   yield testSelect(view, swatch, inspector, testActor);
 
   let onHidden = tooltip.once("hidden");
   tooltip.hide();
   yield onHidden;
   ok(!tooltip.isVisible(), "color picker tooltip is closed");
-
-  yield waitForTick();
 });
 
 function* testESC(swatch, inspector, testActor) {
   info("Press escape");
   let onCanceled = new Promise(resolve => {
     inspector.inspector.once("color-pick-canceled", resolve);
   });
   yield testActor.synthesizeKey({key: "VK_ESCAPE", options: {}});
--- a/devtools/client/inspector/rules/test/browser_rules_filtereditor-appears-on-swatch-click.js
+++ b/devtools/client/inspector/rules/test/browser_rules_filtereditor-appears-on-swatch-click.js
@@ -24,11 +24,9 @@ add_task(function* () {
   swatch.click();
   yield onRuleViewChanged;
 
   ok(true, "The shown event was emitted after clicking on swatch");
   ok(!inplaceEditor(swatch.parentNode),
   "The inplace editor wasn't shown as a result of the filter swatch click");
 
   yield hideTooltipAndWaitForRuleViewChanged(filterTooltip, view);
-
-  yield waitForTick();
 });
--- a/devtools/client/inspector/rules/test/browser_rules_search-filter_context-menu.js
+++ b/devtools/client/inspector/rules/test/browser_rules_search-filter_context-menu.js
@@ -23,37 +23,27 @@ add_task(function* () {
   let cmdUndo = searchContextMenu.querySelector("[command=cmd_undo]");
   let cmdDelete = searchContextMenu.querySelector("[command=cmd_delete]");
   let cmdSelectAll = searchContextMenu.querySelector("[command=cmd_selectAll]");
   let cmdCut = searchContextMenu.querySelector("[command=cmd_cut]");
   let cmdCopy = searchContextMenu.querySelector("[command=cmd_copy]");
   let cmdPaste = searchContextMenu.querySelector("[command=cmd_paste]");
 
   info("Opening context menu");
-
-  emptyClipboard();
-
-  let onFocus = once(searchField, "focus");
-  searchField.focus();
-  yield onFocus;
-
   let onContextMenuPopup = once(searchContextMenu, "popupshowing");
   EventUtils.synthesizeMouse(searchField, 2, 2,
     {type: "contextmenu", button: 2}, win);
   yield onContextMenuPopup;
 
   is(cmdUndo.getAttribute("disabled"), "true", "cmdUndo is disabled");
   is(cmdDelete.getAttribute("disabled"), "true", "cmdDelete is disabled");
-  is(cmdSelectAll.getAttribute("disabled"), "true", "cmdSelectAll is disabled");
+  is(cmdSelectAll.getAttribute("disabled"), "", "cmdSelectAll is enabled");
   is(cmdCut.getAttribute("disabled"), "true", "cmdCut is disabled");
   is(cmdCopy.getAttribute("disabled"), "true", "cmdCopy is disabled");
-  if (isWindows()) {
-    // emptyClipboard only works on Windows (666254), assert paste only for this OS.
-    is(cmdPaste.getAttribute("disabled"), "true", "cmdPaste is disabled");
-  }
+  is(cmdPaste.getAttribute("disabled"), "true", "cmdPaste is disabled");
 
   info("Closing context menu");
   let onContextMenuHidden = once(searchContextMenu, "popuphidden");
   searchContextMenu.hidePopup();
   yield onContextMenuHidden;
 
   info("Copy text in search field using the context menu");
   searchField.value = TEST_INPUT;
--- a/devtools/client/inspector/test/browser.ini
+++ b/devtools/client/inspector/test/browser.ini
@@ -125,16 +125,17 @@ subsuite = clipboard
 subsuite = clipboard
 [browser_inspector_menu-04-use-in-console.js]
 [browser_inspector_menu-05-attribute-items.js]
 [browser_inspector_menu-06-other.js]
 [browser_inspector_navigation.js]
 [browser_inspector_pane-toggle-01.js]
 [browser_inspector_pane-toggle-02.js]
 [browser_inspector_pane-toggle-03.js]
+[browser_inspector_pane-toggle-04.js]
 [browser_inspector_pane-toggle-05.js]
 skip-if = os == "mac" # Full keyboard navigation on OSX only works if Full Keyboard Access setting is set to All Control in System Keyboard
 [browser_inspector_picker-stop-on-destroy.js]
 [browser_inspector_picker-stop-on-tool-change.js]
 [browser_inspector_pseudoclass-lock.js]
 [browser_inspector_pseudoclass-menu.js]
 [browser_inspector_reload-01.js]
 [browser_inspector_reload-02.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/inspector/test/browser_inspector_pane-toggle-04.js
@@ -0,0 +1,65 @@
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+let { Toolbox } = require("devtools/client/framework/toolbox");
+
+// Test that the dimensions of the collapsed inspector panel are not modified
+// when switching from horizontal to vertical layout, which is mandatory to make
+// sure the panel remains visually hidden (using negative margins).
+
+add_task(function* () {
+  info("Set temporary preferences to ensure a small sidebar width.");
+  yield new Promise(resolve => {
+    let options = {"set": [
+      ["devtools.toolsidebar-width.inspector", 200]
+    ]};
+    SpecialPowers.pushPrefEnv(options, resolve);
+  });
+
+  let { inspector, toolbox } = yield openInspectorForURL("about:blank");
+  let button = inspector.panelDoc.querySelector(".sidebar-toggle");
+  let panel = inspector.panelDoc.querySelector("#inspector-splitter-box .controlled");
+
+  info("Changing toolbox host to a window.");
+  yield toolbox.switchHost(Toolbox.HostType.WINDOW);
+
+  let hostWindow = toolbox._host._window;
+  let originalWidth = hostWindow.outerWidth;
+  let originalHeight = hostWindow.outerHeight;
+
+  info("Resizing window to switch to the horizontal layout.");
+  hostWindow.resizeTo(800, 300);
+
+  // Check the sidebar is expanded when the test starts.
+  ok(!panel.classList.contains("pane-collapsed"), "The panel is in expanded state");
+
+  info("Collapse the inspector sidebar.");
+  let onTransitionEnd = once(panel, "transitionend");
+  EventUtils.synthesizeMouseAtCenter(button, {},
+    inspector.panelDoc.defaultView);
+  yield onTransitionEnd;
+
+  ok(panel.classList.contains("pane-collapsed"), "The panel is in collapsed state");
+  let currentPanelHeight = panel.getBoundingClientRect().height;
+  let currentPanelMarginBottom = panel.style.marginBottom;
+
+  info("Resizing window to switch to the vertical layout.");
+  hostWindow.resizeTo(300, 800);
+
+  // Check the panel is collapsed, and still has the same dimensions.
+  ok(panel.classList.contains("pane-collapsed"), "The panel is still collapsed");
+  is(panel.getBoundingClientRect().height, currentPanelHeight,
+    "The panel height has not been modified when changing the layout.");
+  is(panel.style.marginBottom, currentPanelMarginBottom,
+    "The panel margin-bottom has not been modified when changing the layout.");
+
+  info("Restoring window original size.");
+  hostWindow.resizeTo(originalWidth, originalHeight);
+});
+
+registerCleanupFunction(function () {
+  // Restore the host type for other tests.
+  Services.prefs.clearUserPref("devtools.toolbox.host");
+});
--- a/devtools/client/inspector/test/browser_inspector_search-filter_context-menu.js
+++ b/devtools/client/inspector/test/browser_inspector_search-filter_context-menu.js
@@ -14,44 +14,38 @@ add_task(function* () {
   let {searchBox} = inspector;
   yield selectNode("h1", inspector);
 
   let win = inspector.panelWin;
   let searchContextMenu = toolbox.textboxContextMenuPopup;
   ok(searchContextMenu,
     "The search filter context menu is loaded in the inspector");
 
+  emptyClipboard();
+
   let cmdUndo = searchContextMenu.querySelector("[command=cmd_undo]");
   let cmdDelete = searchContextMenu.querySelector("[command=cmd_delete]");
   let cmdSelectAll = searchContextMenu.querySelector("[command=cmd_selectAll]");
   let cmdCut = searchContextMenu.querySelector("[command=cmd_cut]");
   let cmdCopy = searchContextMenu.querySelector("[command=cmd_copy]");
   let cmdPaste = searchContextMenu.querySelector("[command=cmd_paste]");
 
-  emptyClipboard();
-
   info("Opening context menu");
-  let onFocus = once(searchBox, "focus");
   searchBox.focus();
-  yield onFocus;
-
   let onContextMenuPopup = once(searchContextMenu, "popupshowing");
   EventUtils.synthesizeMouse(searchBox, 2, 2,
     {type: "contextmenu", button: 2}, win);
   yield onContextMenuPopup;
 
   is(cmdUndo.getAttribute("disabled"), "true", "cmdUndo is disabled");
   is(cmdDelete.getAttribute("disabled"), "true", "cmdDelete is disabled");
   is(cmdSelectAll.getAttribute("disabled"), "true", "cmdSelectAll is disabled");
   is(cmdCut.getAttribute("disabled"), "true", "cmdCut is disabled");
   is(cmdCopy.getAttribute("disabled"), "true", "cmdCopy is disabled");
-  if (isWindows()) {
-    // emptyClipboard only works on Windows (666254), assert paste only for this OS.
-    is(cmdPaste.getAttribute("disabled"), "true", "cmdPaste is disabled");
-  }
+  is(cmdPaste.getAttribute("disabled"), "true", "cmdPaste is disabled");
 
   info("Closing context menu");
   let onContextMenuHidden = once(searchContextMenu, "popuphidden");
   searchContextMenu.hidePopup();
   yield onContextMenuHidden;
 
   info("Copy text in search field using the context menu");
   searchBox.value = TEST_INPUT;