browser/components/customizableui/test/browser_889120_customize_tab_merging.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 const kTestToolbarId = "test-empty-drag";
michael@0 8
michael@0 9 // Attempting to switch quickly from one tab to another to see whether the state changes
michael@0 10 // correctly.
michael@0 11 add_task(function CheckBasicCustomizeMode() {
michael@0 12 yield startCustomizing();
michael@0 13 ok(CustomizationHandler.isCustomizing(), "We should be in customize mode");
michael@0 14 yield endCustomizing();
michael@0 15 ok(!CustomizationHandler.isCustomizing(), "We should not be in customize mode");
michael@0 16 });
michael@0 17 add_task(function CheckQuickCustomizeModeSwitch() {
michael@0 18 let tab1 = gBrowser.addTab("about:newtab");
michael@0 19 gBrowser.selectedTab = tab1;
michael@0 20 let tab2 = gBrowser.addTab("about:customizing");
michael@0 21 let tab3 = gBrowser.addTab("about:newtab");
michael@0 22 gBrowser.selectedTab = tab2;
michael@0 23 try {
michael@0 24 yield waitForCondition(() => CustomizationHandler.isEnteringCustomizeMode);
michael@0 25 } catch (ex) {
michael@0 26 Cu.reportError(ex);
michael@0 27 }
michael@0 28 ok(CustomizationHandler.isEnteringCustomizeMode, "Should be entering customize mode");
michael@0 29 gBrowser.selectedTab = tab3;
michael@0 30 try {
michael@0 31 yield waitForCondition(() => !CustomizationHandler.isEnteringCustomizeMode && !CustomizationHandler.isCustomizing());
michael@0 32 } catch (ex) {
michael@0 33 Cu.reportError(ex);
michael@0 34 }
michael@0 35 ok(!CustomizationHandler.isCustomizing(), "Should not be entering customize mode");
michael@0 36 gBrowser.removeTab(tab1);
michael@0 37 gBrowser.removeTab(tab2);
michael@0 38 gBrowser.removeTab(tab3);
michael@0 39 });
michael@0 40
michael@0 41 add_task(function asyncCleanup() {
michael@0 42 yield endCustomizing();
michael@0 43 });
michael@0 44

mercurial