1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 const TEST_PATH = getRootDirectory(gTestPath).replace(
6 "chrome://mochitests/content",
9 add_task(async function () {
10 let notificationValue = "Protocol Registration: web+testprotocol";
11 let testURI = TEST_PATH + "browser_registerProtocolHandler_notification.html";
13 BrowserTestUtils.startLoadingURIString(
14 window.gBrowser.selectedBrowser,
17 await TestUtils.waitForCondition(
19 // Do not start until the notification is up
20 let notificationBox = window.gBrowser.getNotificationBox();
22 notificationBox.getNotificationWithValue(notificationValue);
25 "Still can not get notification after retrying 100 times.",
30 let notificationBox = window.gBrowser.getNotificationBox();
32 notificationBox.getNotificationWithValue(notificationValue);
33 ok(notification, "Notification box should be displayed");
34 if (notification == null) {
39 notification.getAttribute("type"),
41 "We expect this notification to have the type of 'info'."
44 // Make sure the CSS is fully loaded...
46 await TestUtils.waitForCondition(
48 notification.ownerGlobal.getComputedStyle(
49 notification.messageImage,
51 ).backgroundImage == 'url("chrome://global/skin/icons/info-filled.svg")'
53 "We expect this notification to have an icon."
56 let buttons = notification.buttonContainer.getElementsByClassName(
59 is(buttons.length, 1, "We expect see one button.");
61 let button = buttons[0];
62 isnot(button.label, null, "We expect the add button to have a label.");
63 todo(button.accesskey, "We expect the add button to have a accesskey.");