Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
4 function runAll(steps) {
5 SimpleTest.waitForExplicitFinish();
7 /**
8 * On Mac, apps aren't considered launchable right after they've been
9 * installed because the OS takes some time to detect them (so
10 * nsIMacWebAppUtils::pathForAppWithIdentifier() returns null).
11 * That causes methods like mgmt.getAll() to exclude the app from their
12 * results, even though the app is installed and is in the registry.
13 * See the tests under toolkit/webapps for a viable solution.
14 *
15 * To work around this problem, set allAppsLaunchable to true, which makes
16 * all apps considered as launchable.
17 */
18 SpecialPowers.setAllAppsLaunchable(true);
20 // Clone the array so we don't modify the original.
21 steps = steps.concat();
22 function next() {
23 if (steps.length) {
24 steps.shift()(next);
25 }
26 else {
27 SimpleTest.finish();
28 }
29 }
30 next();
31 }
33 function confirmNextInstall() {
34 var Ci = SpecialPowers.Ci;
36 var popupPanel = SpecialPowers.wrap(window).top.
37 QueryInterface(Ci.nsIInterfaceRequestor).
38 getInterface(Ci.nsIWebNavigation).
39 QueryInterface(Ci.nsIDocShell).
40 chromeEventHandler.ownerDocument.defaultView.
41 PopupNotifications.panel;
43 function onPopupShown() {
44 popupPanel.removeEventListener("popupshown", onPopupShown, false);
45 SpecialPowers.wrap(this).childNodes[0].button.doCommand();
46 }
47 popupPanel.addEventListener("popupshown", onPopupShown, false);
48 }