Bug 728541. (Av1) browser_bug703210.js: Add a missing removeEventListener(). r=smaug.
authorSerge Gautherie <sgautherie.bz@free.fr>
Sat, 18 Feb 2012 21:49:14 +0100
changeset 87154 e06ab2cf18b88511abdcefbc94eea743d6e3391d
parent 87153 eb82a1f486718666b18b78433ca223bb8fcb5585
child 87155 4d47329bb02ec69afbddaa9034abd5a15516840e
child 89175 9b757be291639d5baad2dd859a13db990278e8d4
push id22085
push usersgautherie.bz@free.fr
push dateSat, 18 Feb 2012 20:50:00 +0000
treeherdermozilla-central@e06ab2cf18b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs728541, 703210
milestone13.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 728541. (Av1) browser_bug703210.js: Add a missing removeEventListener(). r=smaug.
layout/xul/test/browser_bug703210.js
--- a/layout/xul/test/browser_bug703210.js
+++ b/layout/xul/test/browser_bug703210.js
@@ -1,10 +1,11 @@
 function test() {
   waitForExplicitFinish();
+
   gBrowser.selectedTab = gBrowser.addTab();
 
   SpecialPowers.setIntPref("ui.tooltipDelay", 0);
 
   let doStopPropagation = function (aEvent)
   {
     aEvent.stopPropagation();
   }
@@ -55,15 +56,17 @@ function test() {
     doc.addEventListener("mouseover", doStopPropagation, true);
     doc.addEventListener("mouseout", doStopPropagation, true);
     document.addEventListener("popupshown", onPopupShown, true);
     document.addEventListener("popuphiding", onPopupHiding, true);
 
     EventUtils.synthesizeMouseAtCenter(p1, { type: "mousemove" }, win);
   }
 
-  gBrowser.selectedBrowser.addEventListener("load",
-    function () { setTimeout(onLoad, 0); }, true);
+  gBrowser.selectedBrowser.addEventListener("load", function loadListener() {
+    gBrowser.selectedBrowser.removeEventListener("load", loadListener, true);
+    setTimeout(onLoad, 0);
+  }, true);
 
   content.location = "data:text/html," +
     "<p id=\"p1\" title=\"tooltip is here\">This paragraph has a tooltip.</p>" +
     "<p id=\"p2\">This paragraph doesn't have tooltip.</p>";
 }