Skip to content
Snippets Groups Projects
Verified Commit dc7ca927 authored by Emma Zuehlcke's avatar Emma Zuehlcke Committed by ma1
Browse files

Bug 1866661 - Tests, a=dmeehan

parent 48d984fc
Branches
Tags
No related merge requests found
......@@ -6,7 +6,16 @@ const TEST_PATH = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
"https://example.com"
);
const SECURITY_DELAY = 3000;
add_task(async function () {
// Set a custom, higher security delay for the test to avoid races on slow
// builds.
await SpecialPowers.pushPrefEnv({
set: [["security.notification_enable_delay", SECURITY_DELAY]],
});
let notificationValue = "Protocol Registration: web+testprotocol";
let testURI = TEST_PATH + "browser_registerProtocolHandler_notification.html";
......@@ -58,4 +67,16 @@ add_task(async function () {
let button = buttons[0];
isnot(button.label, null, "We expect the add button to have a label.");
todo(button.accesskey, "We expect the add button to have a accesskey.");
ok(button.disabled, "We expect the button to be disabled initially.");
let timeoutMS = SECURITY_DELAY + 100;
info(`Wait ${timeoutMS}ms for the button to enable.`);
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
await new Promise(resolve => setTimeout(resolve, SECURITY_DELAY + 100));
ok(
!button.disabled,
"We expect the button to be enabled after the security delay."
);
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment