Bug 1535278: Cert error pages in iframes should not say 'Warning: Potential Security Risk Ahead' r=johannh
Differential Revision: https://phabricator.services.mozilla.com/D23792
This commit is contained in:
@@ -170,7 +170,7 @@ function initPage() {
|
||||
document.body.classList.add(className);
|
||||
}
|
||||
|
||||
if (gNewErrorPagesEnabled && gIsCertError && className == "badStsCert") {
|
||||
if (gNewErrorPagesEnabled && gIsCertError && (window !== window.top || className == "badStsCert")) {
|
||||
l10nErrId += "_sts";
|
||||
}
|
||||
|
||||
|
||||
@@ -312,3 +312,23 @@ add_task(async function checkViewCertificate() {
|
||||
}
|
||||
Services.prefs.clearUserPref(PREF_NEW_CERT_ERRORS);
|
||||
});
|
||||
|
||||
add_task(async function checkBadStsCertHeadline() {
|
||||
info("Loading a bad sts cert error page and checking that the correct headline is shown");
|
||||
for (let useFrame of [false, true]) {
|
||||
let tab = await openErrorPage(BAD_CERT, useFrame);
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
let titleContent = await ContentTask.spawn(browser, {frame: useFrame}, async function({frame}) {
|
||||
let doc = frame ? content.document.querySelector("iframe").contentDocument : content.document;
|
||||
let titleText = doc.querySelector(".title-text");
|
||||
return titleText.textContent;
|
||||
});
|
||||
if (useFrame) {
|
||||
ok(titleContent.endsWith("Security Issue"), "Did Not Connect: Potential Security Issue");
|
||||
} else {
|
||||
ok(titleContent.endsWith("Risk Ahead"), "Warning: Potential Security Risk Ahead");
|
||||
}
|
||||
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user