summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/general/browser_registerProtocolHandler_notification.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /browser/base/content/test/general/browser_registerProtocolHandler_notification.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'browser/base/content/test/general/browser_registerProtocolHandler_notification.js')
-rw-r--r--browser/base/content/test/general/browser_registerProtocolHandler_notification.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/browser/base/content/test/general/browser_registerProtocolHandler_notification.js b/browser/base/content/test/general/browser_registerProtocolHandler_notification.js
new file mode 100644
index 000000000..b30ece0f6
--- /dev/null
+++ b/browser/base/content/test/general/browser_registerProtocolHandler_notification.js
@@ -0,0 +1,43 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+function test() {
+ waitForExplicitFinish();
+ let notificationValue = "Protocol Registration: testprotocol";
+ let testURI = "http://example.com/browser/" +
+ "browser/base/content/test/general/browser_registerProtocolHandler_notification.html";
+
+ waitForCondition(function() {
+ // Do not start until the notification is up
+ let notificationBox = window.gBrowser.getNotificationBox();
+ let notification = notificationBox.getNotificationWithValue(notificationValue);
+ return notification;
+ },
+ function() {
+
+ let notificationBox = window.gBrowser.getNotificationBox();
+ let notification = notificationBox.getNotificationWithValue(notificationValue);
+ ok(notification, "Notification box should be displayed");
+ if (notification == null) {
+ finish();
+ return;
+ }
+ is(notification.type, "info", "We expect this notification to have the type of 'info'.");
+ isnot(notification.image, null, "We expect this notification to have an icon.");
+
+ let buttons = notification.getElementsByClassName("notification-button-default");
+ is(buttons.length, 1, "We expect see one default button.");
+
+ buttons = notification.getElementsByClassName("notification-button");
+ is(buttons.length, 1, "We expect see one button.");
+
+ let button = buttons[0];
+ isnot(button.label, null, "We expect the add button to have a label.");
+ todo_isnot(button.accesskey, null, "We expect the add button to have a accesskey.");
+
+ finish();
+ }, "Still can not get notification after retry 100 times.", 100);
+
+ window.gBrowser.selectedBrowser.loadURI(testURI);
+}