browser/components/customizableui/test/browser_909779_overflow_toolbars_new_window.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 "use strict";
michael@0 6
michael@0 7 // Resize to a small window, open a new window, check that new window handles overflow properly
michael@0 8 add_task(function() {
michael@0 9 let originalWindowWidth = window.outerWidth;
michael@0 10 let navbar = document.getElementById(CustomizableUI.AREA_NAVBAR);
michael@0 11 ok(!navbar.hasAttribute("overflowing"), "Should start with a non-overflowing toolbar.");
michael@0 12 let oldChildCount = navbar.customizationTarget.childElementCount;
michael@0 13 window.resizeTo(400, window.outerHeight);
michael@0 14 yield waitForCondition(() => navbar.hasAttribute("overflowing"));
michael@0 15 ok(navbar.hasAttribute("overflowing"), "Should have an overflowing toolbar.");
michael@0 16
michael@0 17 ok(navbar.customizationTarget.childElementCount < oldChildCount, "Should have fewer children.");
michael@0 18 let newWindow = yield openAndLoadWindow();
michael@0 19 let otherNavBar = newWindow.document.getElementById(CustomizableUI.AREA_NAVBAR);
michael@0 20 yield waitForCondition(() => otherNavBar.hasAttribute("overflowing"));
michael@0 21 ok(otherNavBar.hasAttribute("overflowing"), "Other window should have an overflowing toolbar.");
michael@0 22 yield promiseWindowClosed(newWindow);
michael@0 23
michael@0 24 window.resizeTo(originalWindowWidth, window.outerHeight);
michael@0 25 yield waitForCondition(() => !navbar.hasAttribute("overflowing"));
michael@0 26 ok(!navbar.hasAttribute("overflowing"), "Should no longer have an overflowing toolbar.");
michael@0 27 });
michael@0 28
michael@0 29 add_task(function asyncCleanup() {
michael@0 30 yield resetCustomization();
michael@0 31 });

mercurial