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 /**
8 * Test opening and closing the menu panel UI.
9 */
11 // Show and hide the menu panel programmatically without an event (like UITour.jsm would)
12 add_task(function() {
13 let shownPromise = promisePanelShown(window);
14 PanelUI.show();
15 yield shownPromise;
17 is(PanelUI.panel.getAttribute("panelopen"), "true", "Check that panel has panelopen attribute");
18 is(PanelUI.panel.state, "open", "Check that panel state is 'open'");
20 let hiddenPromise = promisePanelHidden(window);
21 PanelUI.hide();
22 yield hiddenPromise;
24 ok(!PanelUI.panel.hasAttribute("panelopen"), "Check that panel doesn't have the panelopen attribute");
25 is(PanelUI.panel.state, "closed", "Check that panel state is 'closed'");
26 });
28 // Toggle the menu panel open and closed
29 add_task(function() {
30 let shownPromise = promisePanelShown(window);
31 PanelUI.toggle({type: "command"});
32 yield shownPromise;
34 is(PanelUI.panel.getAttribute("panelopen"), "true", "Check that panel has panelopen attribute");
35 is(PanelUI.panel.state, "open", "Check that panel state is 'open'");
37 let hiddenPromise = promisePanelHidden(window);
38 PanelUI.toggle({type: "command"});
39 yield hiddenPromise;
41 ok(!PanelUI.panel.hasAttribute("panelopen"), "Check that panel doesn't have the panelopen attribute");
42 is(PanelUI.panel.state, "closed", "Check that panel state is 'closed'");
43 });