browser_bug400731.js
Go to the documentation of this file.
1 /* Check for the intended visibility of the "Ignore this warning" text*/
2 var newBrowser
3 
4 function test() {
6 
7  var newTab = gBrowser.addTab();
8  gBrowser.selectedTab = newTab;
9  newBrowser = gBrowser.getBrowserForTab(newTab);
10 
11  // Navigate to malware site. Can't use an onload listener here since
12  // error pages don't fire onload
13  window.addEventListener("DOMContentLoaded", testMalware, true);
14  newBrowser.contentWindow.location = 'http://www.mozilla.com/firefox/its-an-attack.html';
15 }
16 
17 function testMalware() {
18  window.removeEventListener("DOMContentLoaded", testMalware, true);
19 
20  // Confirm that "Ignore this warning" is visible - bug 422410
21  var el = newBrowser.contentDocument.getElementById("ignoreWarningButton");
22  ok(el, "Ignore warning button should be present for malware");
23 
24  var style = newBrowser.contentWindow.getComputedStyle(el, null);
25  is(style.display, "-moz-box", "Ignore Warning button should be display:-moz-box for malware");
26 
27  // Now launch the phishing test
28  window.addEventListener("DOMContentLoaded", testPhishing, true);
29  newBrowser.contentWindow.location = 'http://www.mozilla.com/firefox/its-a-trap.html';
30 }
31 
32 function testPhishing() {
33  window.removeEventListener("DOMContentLoaded", testPhishing, true);
34 
35  var el = newBrowser.contentDocument.getElementById("ignoreWarningButton");
36  ok(el, "Ignore warning button should be present for phishing");
37 
38  var style = newBrowser.contentWindow.getComputedStyle(el, null);
39  is(style.display, "-moz-box", "Ignore Warning button should be display:-moz-box for phishing");
40 
41  gBrowser.removeCurrentTab();
42  finish();
43 }
function newBrowser test()
function testPhishing()
let window
var newBrowser
waitForExplicitFinish()
function testMalware()
return null
Definition: FeedWriter.js:1143
Element Properties style