michael@0: /* Check for the intended visibility of the "Ignore this warning" text*/ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: gBrowser.selectedTab = gBrowser.addTab(); michael@0: michael@0: // Navigate to malware site. Can't use an onload listener here since michael@0: // error pages don't fire onload. Also can't register the DOMContentLoaded michael@0: // handler here because registering it too soon would mean that we might michael@0: // get it for about:blank, and not about:blocked. michael@0: gBrowser.addTabsProgressListener({ michael@0: onLocationChange: function(aTab, aWebProgress, aRequest, aLocation, aFlags) { michael@0: if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) { michael@0: gBrowser.removeTabsProgressListener(this); michael@0: window.addEventListener("DOMContentLoaded", testMalware, true); michael@0: } michael@0: } michael@0: }); michael@0: content.location = "http://www.itisatrap.org/firefox/its-an-attack.html"; michael@0: } michael@0: michael@0: function testMalware() { michael@0: window.removeEventListener("DOMContentLoaded", testMalware, true); michael@0: michael@0: // Confirm that "Ignore this warning" is visible - bug 422410 michael@0: var el = content.document.getElementById("ignoreWarningButton"); michael@0: ok(el, "Ignore warning button should be present for malware"); michael@0: michael@0: var style = content.getComputedStyle(el, null); michael@0: is(style.display, "inline-block", "Ignore Warning button should be display:inline-block for malware"); michael@0: michael@0: // Now launch the phishing test michael@0: window.addEventListener("DOMContentLoaded", testPhishing, true); michael@0: content.location = "http://www.itisatrap.org/firefox/its-a-trap.html"; michael@0: } michael@0: michael@0: function testPhishing() { michael@0: window.removeEventListener("DOMContentLoaded", testPhishing, true); michael@0: michael@0: var el = content.document.getElementById("ignoreWarningButton"); michael@0: ok(el, "Ignore warning button should be present for phishing"); michael@0: michael@0: var style = content.getComputedStyle(el, null); michael@0: is(style.display, "inline-block", "Ignore Warning button should be display:inline-block for phishing"); michael@0: michael@0: gBrowser.removeCurrentTab(); michael@0: finish(); michael@0: }