forked from mirrors/gecko-dev
Bug 1866661 - Tests, a=dmeehan
Differential Revision: https://phabricator.services.mozilla.com/D237737
This commit is contained in:
parent
44335e4a1d
commit
a4f13ef0aa
1 changed files with 21 additions and 0 deletions
|
|
@ -6,7 +6,16 @@ const TEST_PATH = getRootDirectory(gTestPath).replace(
|
||||||
"chrome://mochitests/content",
|
"chrome://mochitests/content",
|
||||||
"https://example.com"
|
"https://example.com"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const SECURITY_DELAY = 3000;
|
||||||
|
|
||||||
add_task(async function () {
|
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 notificationValue = "Protocol Registration: web+testprotocol";
|
||||||
let testURI = TEST_PATH + "browser_registerProtocolHandler_notification.html";
|
let testURI = TEST_PATH + "browser_registerProtocolHandler_notification.html";
|
||||||
|
|
||||||
|
|
@ -54,4 +63,16 @@ add_task(async function () {
|
||||||
let button = buttons[0];
|
let button = buttons[0];
|
||||||
isnot(button.label, null, "We expect the add button to have a label.");
|
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.");
|
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."
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue