michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function runAll(steps) { michael@0: SimpleTest.waitForExplicitFinish(); michael@0: michael@0: /** michael@0: * On Mac, apps aren't considered launchable right after they've been michael@0: * installed because the OS takes some time to detect them (so michael@0: * nsIMacWebAppUtils::pathForAppWithIdentifier() returns null). michael@0: * That causes methods like mgmt.getAll() to exclude the app from their michael@0: * results, even though the app is installed and is in the registry. michael@0: * See the tests under toolkit/webapps for a viable solution. michael@0: * michael@0: * To work around this problem, set allAppsLaunchable to true, which makes michael@0: * all apps considered as launchable. michael@0: */ michael@0: SpecialPowers.setAllAppsLaunchable(true); michael@0: michael@0: // Clone the array so we don't modify the original. michael@0: steps = steps.concat(); michael@0: function next() { michael@0: if (steps.length) { michael@0: steps.shift()(next); michael@0: } michael@0: else { michael@0: SimpleTest.finish(); michael@0: } michael@0: } michael@0: next(); michael@0: } michael@0: michael@0: function confirmNextInstall() { michael@0: var Ci = SpecialPowers.Ci; michael@0: michael@0: var popupPanel = SpecialPowers.wrap(window).top. michael@0: QueryInterface(Ci.nsIInterfaceRequestor). michael@0: getInterface(Ci.nsIWebNavigation). michael@0: QueryInterface(Ci.nsIDocShell). michael@0: chromeEventHandler.ownerDocument.defaultView. michael@0: PopupNotifications.panel; michael@0: michael@0: function onPopupShown() { michael@0: popupPanel.removeEventListener("popupshown", onPopupShown, false); michael@0: SpecialPowers.wrap(this).childNodes[0].button.doCommand(); michael@0: } michael@0: popupPanel.addEventListener("popupshown", onPopupShown, false); michael@0: }