michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: // Resize to a small window, open a new window, check that new window handles overflow properly michael@0: add_task(function() { michael@0: let originalWindowWidth = window.outerWidth; michael@0: let navbar = document.getElementById(CustomizableUI.AREA_NAVBAR); michael@0: ok(!navbar.hasAttribute("overflowing"), "Should start with a non-overflowing toolbar."); michael@0: let oldChildCount = navbar.customizationTarget.childElementCount; michael@0: window.resizeTo(400, window.outerHeight); michael@0: yield waitForCondition(() => navbar.hasAttribute("overflowing")); michael@0: ok(navbar.hasAttribute("overflowing"), "Should have an overflowing toolbar."); michael@0: michael@0: ok(navbar.customizationTarget.childElementCount < oldChildCount, "Should have fewer children."); michael@0: let newWindow = yield openAndLoadWindow(); michael@0: let otherNavBar = newWindow.document.getElementById(CustomizableUI.AREA_NAVBAR); michael@0: yield waitForCondition(() => otherNavBar.hasAttribute("overflowing")); michael@0: ok(otherNavBar.hasAttribute("overflowing"), "Other window should have an overflowing toolbar."); michael@0: yield promiseWindowClosed(newWindow); michael@0: michael@0: window.resizeTo(originalWindowWidth, window.outerHeight); michael@0: yield waitForCondition(() => !navbar.hasAttribute("overflowing")); michael@0: ok(!navbar.hasAttribute("overflowing"), "Should no longer have an overflowing toolbar."); michael@0: }); michael@0: michael@0: add_task(function asyncCleanup() { michael@0: yield resetCustomization(); michael@0: });