Source code

Revision control

Copy as Markdown

Other Tools

/* Any copyright is dedicated to the Public Domain.
"use strict";
Services.scriptloader.loadSubScript(
this
);
registerCleanupFunction(async () => {
await UrlbarTestUtils.promisePopupClose(window);
});
async function loadBadCertPage(url) {
const loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
const loadFlagsSkipCache =
Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY |
Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE;
BrowserTestUtils.startLoadingURIString(
gBrowser.selectedBrowser,
url,
loadFlagsSkipCache
);
await loaded;
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async () => {
const netErrorCard =
content.document.querySelector("net-error-card").wrappedJSObject;
await netErrorCard.getUpdateComplete();
EventUtils.synthesizeMouseAtCenter(
netErrorCard.advancedButton,
{},
content
);
await ContentTaskUtils.waitForCondition(() => {
return (
netErrorCard.exceptionButton && !netErrorCard.exceptionButton.disabled
);
}, "Waiting for exception button");
netErrorCard.exceptionButton.scrollIntoView(true);
EventUtils.synthesizeMouseAtCenter(
netErrorCard.exceptionButton,
{},
content
);
});
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
}