Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'linux' && os_version == '22.04' && arch == 'x86_64' && display == 'wayland' && debug OR os == 'linux' && os_version == '24.04' && arch == 'x86_64' && display == 'x11' && asan OR os == 'linux' && os_version == '24.04' && arch == 'x86_64' && display == 'x11' && debug
- Manifest: browser/base/content/test/popupNotifications/browser.toml
/* 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
// Test reused popupnotifications must update its
// secondary button between "split" and "default" as secondary actions change.
function test() {
waitForExplicitFinish();
let popupnotification = document.createXULElement("popupnotification");
popupnotification.id = "dropmarker-reuse-test-notification";
popupnotification.hidden = true;
document.documentElement.appendChild(popupnotification);
registerCleanupFunction(() => popupnotification.remove());
setup();
}
var tests = [
{
id: "two-secondary-actions",
run() {
this.notifyObj = new BasicNotification(this.id);
this.notifyObj.id = "dropmarker-reuse-test";
this.notifyObj.secondaryActions = [
{ label: "Second", accessKey: "S", callback() {} },
{ label: "Third", accessKey: "T", callback() {} },
];
showNotification(this.notifyObj);
},
onShown(popup) {
let notification = popup.childNodes[0];
ok(!notification.hasAttribute("dropmarkerhidden"), "dropmarker is shown");
is(notification.secondaryButton.type, "split", "split button");
triggerMainCommand(popup);
},
onHidden() {},
},
{
id: "one-secondary-action-after-reuse",
run() {
this.notifyObj = new BasicNotification(this.id);
this.notifyObj.id = "dropmarker-reuse-test";
this.notifyObj.secondaryActions = [
{ label: "Second", accessKey: "S", callback() {} },
];
showNotification(this.notifyObj);
},
onShown(popup) {
let notification = popup.childNodes[0];
ok(notification.hasAttribute("dropmarkerhidden"), "dropmarker is hidden");
is(notification.secondaryButton.type, "default", "default button");
triggerMainCommand(popup);
},
onHidden() {},
},
];