browser/base/content/test/general/browser_customize_popupNotification.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/base/content/test/general/browser_customize_popupNotification.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,30 @@
     1.4 +/*
     1.5 +Any copyright is dedicated to the Public Domain.
     1.6 +http://creativecommons.org/publicdomain/zero/1.0/
     1.7 +*/
     1.8 +
     1.9 +function test() {
    1.10 +  waitForExplicitFinish();
    1.11 +  let newWin = OpenBrowserWindow();
    1.12 +  whenDelayedStartupFinished(newWin, function () {
    1.13 +    // Remove the URL bar
    1.14 +    newWin.gURLBar.parentNode.removeChild(newWin.gURLBar);
    1.15 +
    1.16 +    waitForFocus(function () {
    1.17 +      let PN = newWin.PopupNotifications;
    1.18 +      PN.transitionsEnabled = false;
    1.19 +      try {
    1.20 +        let notification = PN.show(newWin.gBrowser.selectedBrowser, "some-notification", "Some message");
    1.21 +        ok(notification, "showed the notification");
    1.22 +        ok(PN.isPanelOpen, "panel is open");
    1.23 +        is(PN.panel.anchorNode, newWin.gBrowser.selectedTab, "notification is correctly anchored to the tab");
    1.24 +        PN.panel.hidePopup();
    1.25 +      } catch (ex) {
    1.26 +        ok(false, "threw exception: " + ex);
    1.27 +      }
    1.28 +      PN.transitionsEnabled = true;
    1.29 +      newWin.close();
    1.30 +      finish();
    1.31 +    }, newWin);
    1.32 +  });
    1.33 +}

mercurial