Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 "use strict";
7 add_task(function() {
8 ok(CustomizableUI.inDefaultState, "Should start in default state.");
9 this.otherWin = yield openAndLoadWindow({private: true}, true);
10 yield startCustomizing(this.otherWin);
11 let resetButton = this.otherWin.document.getElementById("customization-reset-button");
12 ok(resetButton.disabled, "Reset button should be disabled");
14 if (typeof CustomizableUI.setToolbarVisibility == "function") {
15 CustomizableUI.setToolbarVisibility("PersonalToolbar", true);
16 } else {
17 setToolbarVisibility(document.getElementById("PersonalToolbar"), true);
18 }
20 let otherPersonalToolbar = this.otherWin.document.getElementById("PersonalToolbar");
21 let personalToolbar = document.getElementById("PersonalToolbar");
22 ok(!otherPersonalToolbar.collapsed, "Toolbar should be uncollapsed in private window");
23 ok(!personalToolbar.collapsed, "Toolbar should be uncollapsed in normal window");
24 ok(!resetButton.disabled, "Reset button should be enabled");
26 yield this.otherWin.gCustomizeMode.reset();
28 ok(otherPersonalToolbar.collapsed, "Toolbar should be collapsed in private window");
29 ok(personalToolbar.collapsed, "Toolbar should be collapsed in normal window");
30 ok(resetButton.disabled, "Reset button should be disabled");
32 yield endCustomizing(this.otherWin);
34 yield promiseWindowClosed(this.otherWin);
35 });
38 add_task(function asyncCleanup() {
39 if (this.otherWin && !this.otherWin.closed) {
40 yield promiseWindowClosed(this.otherWin);
41 }
42 if (!CustomizableUI.inDefaultState) {
43 CustomizableUI.reset();
44 }
45 });