2008-03-12 13:34:31 -07:00
|
|
|
/* Check for the intended visibility of the "Ignore this warning" text*/
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
2009-09-16 03:21:19 -07:00
|
|
|
gBrowser.selectedTab = gBrowser.addTab();
|
2008-03-12 13:34:31 -07:00
|
|
|
|
|
|
|
// Navigate to malware site. Can't use an onload listener here since
|
2012-10-12 09:07:25 -07:00
|
|
|
// error pages don't fire onload. Also can't register the DOMContentLoaded
|
|
|
|
// handler here because registering it too soon would mean that we might
|
|
|
|
// get it for about:blank, and not about:blocked.
|
|
|
|
gBrowser.addTabsProgressListener({
|
|
|
|
onLocationChange: function(aTab, aWebProgress, aRequest, aLocation, aFlags) {
|
|
|
|
if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) {
|
|
|
|
gBrowser.removeTabsProgressListener(this);
|
|
|
|
window.addEventListener("DOMContentLoaded", testMalware, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2014-03-07 10:12:23 -08:00
|
|
|
content.location = "http://www.itisatrap.org/firefox/its-an-attack.html";
|
2008-03-12 13:34:31 -07:00
|
|
|
}
|
|
|
|
|
2014-11-20 13:03:44 -08:00
|
|
|
function testMalware(event) {
|
|
|
|
if (event.target != gBrowser.selectedBrowser.contentDocument) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-04-21 13:17:14 -07:00
|
|
|
window.removeEventListener("DOMContentLoaded", testMalware, true);
|
|
|
|
|
2008-04-08 12:30:01 -07:00
|
|
|
// Confirm that "Ignore this warning" is visible - bug 422410
|
2009-09-16 03:21:19 -07:00
|
|
|
var el = content.document.getElementById("ignoreWarningButton");
|
2008-04-08 12:30:01 -07:00
|
|
|
ok(el, "Ignore warning button should be present for malware");
|
2008-03-12 13:34:31 -07:00
|
|
|
|
2009-09-16 03:21:19 -07:00
|
|
|
var style = content.getComputedStyle(el, null);
|
2012-06-01 08:45:37 -07:00
|
|
|
is(style.display, "inline-block", "Ignore Warning button should be display:inline-block for malware");
|
2008-03-12 13:34:31 -07:00
|
|
|
|
|
|
|
// Now launch the phishing test
|
2009-04-21 13:17:14 -07:00
|
|
|
window.addEventListener("DOMContentLoaded", testPhishing, true);
|
2014-03-07 10:12:23 -08:00
|
|
|
content.location = "http://www.itisatrap.org/firefox/its-a-trap.html";
|
2008-03-12 13:34:31 -07:00
|
|
|
}
|
|
|
|
|
2014-11-20 13:03:44 -08:00
|
|
|
function testPhishing(event) {
|
|
|
|
if (event.target != gBrowser.selectedBrowser.contentDocument) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-04-21 13:17:14 -07:00
|
|
|
window.removeEventListener("DOMContentLoaded", testPhishing, true);
|
|
|
|
|
2009-09-16 03:21:19 -07:00
|
|
|
var el = content.document.getElementById("ignoreWarningButton");
|
2008-03-12 13:34:31 -07:00
|
|
|
ok(el, "Ignore warning button should be present for phishing");
|
|
|
|
|
2009-09-16 03:21:19 -07:00
|
|
|
var style = content.getComputedStyle(el, null);
|
2012-06-01 08:45:37 -07:00
|
|
|
is(style.display, "inline-block", "Ignore Warning button should be display:inline-block for phishing");
|
2008-03-12 13:34:31 -07:00
|
|
|
|
|
|
|
gBrowser.removeCurrentTab();
|
|
|
|
finish();
|
|
|
|
}
|