2008-03-12 13:34:31 -07:00
|
|
|
/* Check for the intended visibility of the "Ignore this warning" text*/
|
|
|
|
var newBrowser
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
|
|
|
var newTab = gBrowser.addTab();
|
|
|
|
gBrowser.selectedTab = newTab;
|
|
|
|
newBrowser = gBrowser.getBrowserForTab(newTab);
|
|
|
|
|
|
|
|
// Navigate to malware site. Can't use an onload listener here since
|
|
|
|
// error pages don't fire onload
|
2009-04-21 13:17:14 -07:00
|
|
|
window.addEventListener("DOMContentLoaded", testMalware, true);
|
2008-03-12 13:34:31 -07:00
|
|
|
newBrowser.contentWindow.location = 'http://www.mozilla.com/firefox/its-an-attack.html';
|
|
|
|
}
|
|
|
|
|
|
|
|
function testMalware() {
|
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
|
2008-03-12 13:34:31 -07:00
|
|
|
var el = newBrowser.contentDocument.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
|
|
|
|
|
|
|
var style = newBrowser.contentWindow.getComputedStyle(el, null);
|
2008-04-08 12:30:01 -07:00
|
|
|
is(style.display, "-moz-box", "Ignore Warning button should be display:-moz-box 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);
|
2008-03-12 13:34:31 -07:00
|
|
|
newBrowser.contentWindow.location = 'http://www.mozilla.com/firefox/its-a-trap.html';
|
|
|
|
}
|
|
|
|
|
|
|
|
function testPhishing() {
|
2009-04-21 13:17:14 -07:00
|
|
|
window.removeEventListener("DOMContentLoaded", testPhishing, true);
|
|
|
|
|
2008-03-12 13:34:31 -07:00
|
|
|
var el = newBrowser.contentDocument.getElementById("ignoreWarningButton");
|
|
|
|
ok(el, "Ignore warning button should be present for phishing");
|
|
|
|
|
|
|
|
var style = newBrowser.contentWindow.getComputedStyle(el, null);
|
|
|
|
is(style.display, "-moz-box", "Ignore Warning button should be display:-moz-box for phishing");
|
|
|
|
|
|
|
|
gBrowser.removeCurrentTab();
|
|
|
|
finish();
|
|
|
|
}
|