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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /*
michael@0 2 Any copyright is dedicated to the Public Domain.
michael@0 3 http://creativecommons.org/publicdomain/zero/1.0/
michael@0 4 */
michael@0 5
michael@0 6 function test() {
michael@0 7 waitForExplicitFinish();
michael@0 8 let newWin = OpenBrowserWindow();
michael@0 9 whenDelayedStartupFinished(newWin, function () {
michael@0 10 // Remove the URL bar
michael@0 11 newWin.gURLBar.parentNode.removeChild(newWin.gURLBar);
michael@0 12
michael@0 13 waitForFocus(function () {
michael@0 14 let PN = newWin.PopupNotifications;
michael@0 15 PN.transitionsEnabled = false;
michael@0 16 try {
michael@0 17 let notification = PN.show(newWin.gBrowser.selectedBrowser, "some-notification", "Some message");
michael@0 18 ok(notification, "showed the notification");
michael@0 19 ok(PN.isPanelOpen, "panel is open");
michael@0 20 is(PN.panel.anchorNode, newWin.gBrowser.selectedTab, "notification is correctly anchored to the tab");
michael@0 21 PN.panel.hidePopup();
michael@0 22 } catch (ex) {
michael@0 23 ok(false, "threw exception: " + ex);
michael@0 24 }
michael@0 25 PN.transitionsEnabled = true;
michael@0 26 newWin.close();
michael@0 27 finish();
michael@0 28 }, newWin);
michael@0 29 });
michael@0 30 }

mercurial