michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: let notificationValue = "Protocol Registration: testprotocol"; michael@0: let testURI = "http://example.com/browser/" + michael@0: "browser/base/content/test/general/browser_registerProtocolHandler_notification.html"; michael@0: michael@0: waitForCondition(function() { michael@0: // Do not start until the notification is up michael@0: let notificationBox = window.gBrowser.getNotificationBox(); michael@0: let notification = notificationBox.getNotificationWithValue(notificationValue); michael@0: return notification; michael@0: }, michael@0: function() { michael@0: michael@0: let notificationBox = window.gBrowser.getNotificationBox(); michael@0: let notification = notificationBox.getNotificationWithValue(notificationValue); michael@0: ok(notification, "Notification box should be displayed"); michael@0: is(notification.type, "info", "We expect this notification to have the type of 'info'."); michael@0: isnot(notification.image, null, "We expect this notification to have an icon."); michael@0: michael@0: let buttons = notification.getElementsByClassName("notification-button-default"); michael@0: is(buttons.length, 1, "We expect see one default button."); michael@0: michael@0: buttons = notification.getElementsByClassName("notification-button"); michael@0: is(buttons.length, 1, "We expect see one button."); michael@0: michael@0: let button = buttons[0]; michael@0: isnot(button.label, null, "We expect the add button to have a label."); michael@0: todo_isnot(button.accesskey, null, "We expect the add button to have a accesskey."); michael@0: michael@0: finish(); michael@0: }, 100); michael@0: michael@0: window.gBrowser.selectedBrowser.loadURI(testURI); michael@0: }