Bug 1220781 - Hide the exception button, not advanced section for badStsCert or cert errors in frames;r=MattN

--HG--
extra : commitid : 3YNVoTpu5z2
This commit is contained in:
Brian Grinstead 2015-11-02 16:09:16 -08:00
Родитель 902cea2b9a
Коммит 8e05c079ec
2 изменённых файлов: 23 добавлений и 2 удалений

Просмотреть файл

@ -95,7 +95,7 @@
// host and the cert is bad (STS Spec section 7.3) or if the
// certerror is in a frame (bug 633691).
if (cssClass == "badStsCert" || window != top) {
document.getElementById("advancedPanel").setAttribute("hidden", "true");
document.getElementById("exceptionDialogButton").setAttribute("hidden", "true");
}
if (cssClass != "badStsCert") {
document.getElementById("badStsCertExplanation").setAttribute("hidden", "true");

Просмотреть файл

@ -2,10 +2,11 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
// This is testing the aboutCertError page (Bug 1207107). It's a start,
// but should be expanded to include cert_domain_link / badStsCert
// but should be expanded to include cert_domain_link
const GOOD_PAGE = "https://example.com/";
const BAD_CERT = "https://expired.example.com/";
const BAD_STS_CERT = "https://badchain.include-subdomains.pinning.example.com:443";
add_task(function* checkReturnToAboutHome() {
info("Loading a bad cert page directly and making sure 'return to previous page' goes to about:home");
@ -68,6 +69,26 @@ add_task(function* checkReturnToPreviousPage() {
gBrowser.removeCurrentTab();
});
add_task(function* checkBadStsCert() {
info("Loading a badStsCert and making sure exception button doesn't show up");
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, GOOD_PAGE);
let browser = gBrowser.selectedBrowser;
info("Loading and waiting for the cert error");
let certErrorLoaded = waitForCertErrorLoad(browser);
BrowserTestUtils.loadURI(browser, BAD_STS_CERT);
yield certErrorLoaded;
let exceptionButtonHidden = yield ContentTask.spawn(browser, null, function* () {
let doc = content.document;
let exceptionButton = doc.getElementById("exceptionDialogButton");
return exceptionButton.hidden;
});
ok(exceptionButtonHidden, "Exception button is hidden");
gBrowser.removeCurrentTab();
});
function waitForCertErrorLoad(browser) {
return new Promise(resolve => {
info("Waiting for DOMContentLoaded event");