browser/components/customizableui/test/browser_934113_menubar_removable.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/customizableui/test/browser_934113_menubar_removable.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,30 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +"use strict";
     1.9 +
    1.10 +// Attempting to drag the menubar to the navbar shouldn't work.
    1.11 +add_task(function() {
    1.12 +  yield startCustomizing();
    1.13 +  let menuItems = document.getElementById("menubar-items");
    1.14 +  let navbar = document.getElementById("nav-bar");
    1.15 +  let menubar = document.getElementById("toolbar-menubar");
    1.16 +  // Force the menu to be shown.
    1.17 +  const kAutohide = menubar.getAttribute("autohide");
    1.18 +  menubar.setAttribute("autohide", "false");
    1.19 +  simulateItemDrag(menuItems, navbar.customizationTarget);
    1.20 +
    1.21 +  is(getAreaWidgetIds("nav-bar").indexOf("menubar-items"), -1, "Menu bar shouldn't be in the navbar.");
    1.22 +  ok(!navbar.querySelector("#menubar-items"), "Shouldn't find menubar items in the navbar.");
    1.23 +  ok(menubar.querySelector("#menubar-items"), "Should find menubar items in the menubar.");
    1.24 +  isnot(getAreaWidgetIds("toolbar-menubar").indexOf("menubar-items"), -1,
    1.25 +        "Menubar items shouldn't be missing from the navbar.");
    1.26 +  menubar.setAttribute("autohide", kAutohide);
    1.27 +  yield endCustomizing();
    1.28 +});
    1.29 +
    1.30 +add_task(function asyncCleanup() {
    1.31 +  yield endCustomizing();
    1.32 +  yield resetCustomization();
    1.33 +});

mercurial