Bug 546169 - Use an event listener instead of a timeout to avoid intermittent failures. r=gavin
authorSteven MacLeod <smacleod@mozilla.com>
Sun, 15 Dec 2013 14:05:53 -0500
changeset 160542 139cdac4f380c74344d6d93b9395fad12bab6519
parent 160541 93120ca81d5a0f1601874c7ace54310d28909082
child 160543 e9ca04f323d0106f095ce2c0dd77f634ceea0652
push id25836
push userphilringnalda@gmail.com
push dateMon, 16 Dec 2013 01:58:54 +0000
treeherdermozilla-central@f8fea5ea69a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs546169
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 546169 - Use an event listener instead of a timeout to avoid intermittent failures. r=gavin
browser/components/safebrowsing/content/test/browser.ini
browser/components/safebrowsing/content/test/browser_bug415846.js
--- a/browser/components/safebrowsing/content/test/browser.ini
+++ b/browser/components/safebrowsing/content/test/browser.ini
@@ -1,8 +1,8 @@
 [DEFAULT]
 support-files = head.js
 
 [browser_bug400731.js]
-# [browser_bug415846.js]
-# Disabled for too many intermittent failures (bug 546169)
-# Previously disabled on Mac because of its bizarre special-and-unique
+[browser_bug415846.js]
+skip-if = os == "mac"
+# Disabled on Mac because of its bizarre special-and-unique
 # snowflake of a help menu.
--- a/browser/components/safebrowsing/content/test/browser_bug415846.js
+++ b/browser/components/safebrowsing/content/test/browser_bug415846.js
@@ -32,21 +32,23 @@ function testNormal_PopupListener() {
   var reportMenu = document.getElementById("menu_HelpPopup_reportPhishingtoolmenu");
   var errorMenu = document.getElementById("menu_HelpPopup_reportPhishingErrortoolmenu");
   is(reportMenu.hidden, false, "Report phishing menu should be visible on normal sites");
   is(errorMenu.hidden, true, "Report error menu item should be hidden on normal sites");
   menu.hidePopup();
   
   // Now launch the phishing test.  Can't use onload here because error pages don't
   // fire normal load events.
+  window.addEventListener("DOMContentLoaded", testPhishing, true);
   content.location = "http://www.mozilla.org/firefox/its-a-trap.html";
-  setTimeout(testPhishing, 2000);
 }
 
 function testPhishing() {
+  window.removeEventListener("DOMContentLoaded", testPhishing, true);
+
   menu.addEventListener("popupshown", testPhishing_PopupListener, false);
   menu.openPopup(null, "", 0, 0, false, null);
 }
 
 function testPhishing_PopupListener() {
   menu.removeEventListener("popupshown", testPhishing_PopupListener, false);
   
   var reportMenu = document.getElementById("menu_HelpPopup_reportPhishingtoolmenu");