Wed, 31 Dec 2014 13:27:57 +0100
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 | add_task(function() { |
michael@0 | 8 | ok(CustomizableUI.inDefaultState, "Should start in default state."); |
michael@0 | 9 | this.otherWin = yield openAndLoadWindow({private: true}, true); |
michael@0 | 10 | yield startCustomizing(this.otherWin); |
michael@0 | 11 | let resetButton = this.otherWin.document.getElementById("customization-reset-button"); |
michael@0 | 12 | ok(resetButton.disabled, "Reset button should be disabled"); |
michael@0 | 13 | |
michael@0 | 14 | if (typeof CustomizableUI.setToolbarVisibility == "function") { |
michael@0 | 15 | CustomizableUI.setToolbarVisibility("PersonalToolbar", true); |
michael@0 | 16 | } else { |
michael@0 | 17 | setToolbarVisibility(document.getElementById("PersonalToolbar"), true); |
michael@0 | 18 | } |
michael@0 | 19 | |
michael@0 | 20 | let otherPersonalToolbar = this.otherWin.document.getElementById("PersonalToolbar"); |
michael@0 | 21 | let personalToolbar = document.getElementById("PersonalToolbar"); |
michael@0 | 22 | ok(!otherPersonalToolbar.collapsed, "Toolbar should be uncollapsed in private window"); |
michael@0 | 23 | ok(!personalToolbar.collapsed, "Toolbar should be uncollapsed in normal window"); |
michael@0 | 24 | ok(!resetButton.disabled, "Reset button should be enabled"); |
michael@0 | 25 | |
michael@0 | 26 | yield this.otherWin.gCustomizeMode.reset(); |
michael@0 | 27 | |
michael@0 | 28 | ok(otherPersonalToolbar.collapsed, "Toolbar should be collapsed in private window"); |
michael@0 | 29 | ok(personalToolbar.collapsed, "Toolbar should be collapsed in normal window"); |
michael@0 | 30 | ok(resetButton.disabled, "Reset button should be disabled"); |
michael@0 | 31 | |
michael@0 | 32 | yield endCustomizing(this.otherWin); |
michael@0 | 33 | |
michael@0 | 34 | yield promiseWindowClosed(this.otherWin); |
michael@0 | 35 | }); |
michael@0 | 36 | |
michael@0 | 37 | |
michael@0 | 38 | add_task(function asyncCleanup() { |
michael@0 | 39 | if (this.otherWin && !this.otherWin.closed) { |
michael@0 | 40 | yield promiseWindowClosed(this.otherWin); |
michael@0 | 41 | } |
michael@0 | 42 | if (!CustomizableUI.inDefaultState) { |
michael@0 | 43 | CustomizableUI.reset(); |
michael@0 | 44 | } |
michael@0 | 45 | }); |