dom/tests/mochitest/webapps/head.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     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 }

mercurial