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: const kTestToolbarId = "test-empty-drag"; michael@0: michael@0: // Attempting to switch quickly from one tab to another to see whether the state changes michael@0: // correctly. michael@0: add_task(function CheckBasicCustomizeMode() { michael@0: yield startCustomizing(); michael@0: ok(CustomizationHandler.isCustomizing(), "We should be in customize mode"); michael@0: yield endCustomizing(); michael@0: ok(!CustomizationHandler.isCustomizing(), "We should not be in customize mode"); michael@0: }); michael@0: add_task(function CheckQuickCustomizeModeSwitch() { michael@0: let tab1 = gBrowser.addTab("about:newtab"); michael@0: gBrowser.selectedTab = tab1; michael@0: let tab2 = gBrowser.addTab("about:customizing"); michael@0: let tab3 = gBrowser.addTab("about:newtab"); michael@0: gBrowser.selectedTab = tab2; michael@0: try { michael@0: yield waitForCondition(() => CustomizationHandler.isEnteringCustomizeMode); michael@0: } catch (ex) { michael@0: Cu.reportError(ex); michael@0: } michael@0: ok(CustomizationHandler.isEnteringCustomizeMode, "Should be entering customize mode"); michael@0: gBrowser.selectedTab = tab3; michael@0: try { michael@0: yield waitForCondition(() => !CustomizationHandler.isEnteringCustomizeMode && !CustomizationHandler.isCustomizing()); michael@0: } catch (ex) { michael@0: Cu.reportError(ex); michael@0: } michael@0: ok(!CustomizationHandler.isCustomizing(), "Should not be entering customize mode"); michael@0: gBrowser.removeTab(tab1); michael@0: gBrowser.removeTab(tab2); michael@0: gBrowser.removeTab(tab3); michael@0: }); michael@0: michael@0: add_task(function asyncCleanup() { michael@0: yield endCustomizing(); michael@0: }); michael@0: