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: add_task(function() { michael@0: ok(CustomizableUI.inDefaultState, "Should start in default state."); michael@0: this.otherWin = yield openAndLoadWindow({private: true}, true); michael@0: yield startCustomizing(this.otherWin); michael@0: let resetButton = this.otherWin.document.getElementById("customization-reset-button"); michael@0: ok(resetButton.disabled, "Reset button should be disabled"); michael@0: michael@0: if (typeof CustomizableUI.setToolbarVisibility == "function") { michael@0: CustomizableUI.setToolbarVisibility("PersonalToolbar", true); michael@0: } else { michael@0: setToolbarVisibility(document.getElementById("PersonalToolbar"), true); michael@0: } michael@0: michael@0: let otherPersonalToolbar = this.otherWin.document.getElementById("PersonalToolbar"); michael@0: let personalToolbar = document.getElementById("PersonalToolbar"); michael@0: ok(!otherPersonalToolbar.collapsed, "Toolbar should be uncollapsed in private window"); michael@0: ok(!personalToolbar.collapsed, "Toolbar should be uncollapsed in normal window"); michael@0: ok(!resetButton.disabled, "Reset button should be enabled"); michael@0: michael@0: yield this.otherWin.gCustomizeMode.reset(); michael@0: michael@0: ok(otherPersonalToolbar.collapsed, "Toolbar should be collapsed in private window"); michael@0: ok(personalToolbar.collapsed, "Toolbar should be collapsed in normal window"); michael@0: ok(resetButton.disabled, "Reset button should be disabled"); michael@0: michael@0: yield endCustomizing(this.otherWin); michael@0: michael@0: yield promiseWindowClosed(this.otherWin); michael@0: }); michael@0: michael@0: michael@0: add_task(function asyncCleanup() { michael@0: if (this.otherWin && !this.otherWin.closed) { michael@0: yield promiseWindowClosed(this.otherWin); michael@0: } michael@0: if (!CustomizableUI.inDefaultState) { michael@0: CustomizableUI.reset(); michael@0: } michael@0: });