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 let initialLocation = gBrowser.currentURI.spec;
8 let newTab = null;
10 add_task(function() {
11 info("Check Sync button functionality");
12 Services.prefs.setCharPref("identity.fxaccounts.remote.signup.uri", "http://example.com/");
14 // add the Sync button to the panel
15 CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL);
17 // check the button's functionality
18 yield PanelUI.show();
20 let syncButton = document.getElementById("sync-button");
21 ok(syncButton, "The Sync button was added to the Panel Menu");
22 syncButton.click();
24 newTab = gBrowser.selectedTab;
25 yield promiseTabLoadEvent(newTab, "about:accounts");
27 is(gBrowser.currentURI.spec, "about:accounts", "Firefox Sync page opened");
28 ok(!isPanelUIOpen(), "The panel closed");
30 if(isPanelUIOpen()) {
31 let panelHidePromise = promisePanelHidden(window);
32 PanelUI.hide();
33 yield panelHidePromise;
34 }
35 });
37 add_task(function asyncCleanup() {
38 Services.prefs.clearUserPref("identity.fxaccounts.remote.signup.uri");
39 // reset the panel UI to the default state
40 yield resetCustomization();
41 ok(CustomizableUI.inDefaultState, "The panel UI is in default state again.");
43 // restore the tabs
44 gBrowser.addTab(initialLocation);
45 gBrowser.removeTab(newTab);
46 });