mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1075081 - Enhance pinning test to ensure the neterror page the one found. r=keeler
This commit is contained in:
parent
564ea347f1
commit
743e192723
@ -69,24 +69,18 @@ let successfulPinningPageListener = {
|
||||
// The browser should load about:neterror, when this happens, proceed
|
||||
// to load the pinning domain again, this time removing the pinning information
|
||||
let certErrorProgressListener = {
|
||||
buttonClicked: false,
|
||||
onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
|
||||
let self = this;
|
||||
// Can't directly call button.click() in onStateChange
|
||||
executeSoon(function() {
|
||||
let button = content.document.getElementById("errorTryAgain");
|
||||
// If about:neterror hasn't fully loaded, the button won't be present.
|
||||
// It will eventually be there, however.
|
||||
if (button && !self.buttonClicked) {
|
||||
gBrowser.removeProgressListener(self);
|
||||
let textElement = content.document.getElementById("errorShortDescText");
|
||||
let text = textElement.innerHTML;
|
||||
ok(text.indexOf("mozilla_pkix_error_key_pinning_failure") > 0,
|
||||
"Got a pinning error page");
|
||||
gBrowser.removeProgressListener(this);
|
||||
gBrowser.selectedBrowser.addEventListener("load",
|
||||
successfulPinningRemovalPageListener,
|
||||
true);
|
||||
gBrowser.selectedBrowser.loadURI("https://" + kPinningDomain + kURLPath + "zeromaxagevalid");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user