Bug 658738 - Don't leak test-console.html in browser_webconsole_bug_580001_closing_after_completion.js
authorDão Gottwald <dao@mozilla.com>
Wed, 06 Jul 2011 10:56:56 +0200
changeset 72413 7cbeab4cc868bdfbe25623ae77dd619475d2743a
parent 72412 7daa4cc9fb074d86e93882726834a52657050155
child 72414 6f1642e856e9562408f4e4231942fa613a01e3be
push id424
push usermlamouri@mozilla.com
push dateWed, 06 Jul 2011 12:49:13 +0000
treeherdermozilla-inbound@f80f2c261345 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs658738
milestone8.0a1
first release with
nightly win64
7cbeab4cc868 / 8.0a1 / 20110706030235 / files
nightly linux32
nightly linux64
nightly mac
nightly win32
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly win64
Bug 658738 - Don't leak test-console.html in browser_webconsole_bug_580001_closing_after_completion.js
toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580001_closing_after_completion.js
--- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580001_closing_after_completion.js
+++ b/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_580001_closing_after_completion.js
@@ -56,26 +56,26 @@ function testClosingAfterCompletion() {
   openConsole();
 
   hudId = HUDService.displaysIndex()[0];
   hudBox = HUDService.getHeadsUpDisplay(hudId);
   let inputNode = hudBox.querySelector(".jsterm-input-node");
 
   let errorWhileClosing = false;
   function errorListener(evt) {
-    browser.removeEventListener("error", errorListener, false);
     errorWhileClosing = true;
   }
 
   browser.addEventListener("error", errorListener, false);
 
   // Focus the inputNode and perform the keycombo to close the WebConsole.
   inputNode.focus();
   EventUtils.synthesizeKey("k", { accelKey: true, shiftKey: true });
 
   // We can't test for errors right away, because the error occures after a
   // setTimeout(..., 0) in the WebConsole code.
   executeSoon(function() {
+    browser.removeEventListener("error", errorListener, false);
     is(errorWhileClosing, false, "no error while closing the WebConsole");
     finishTest();
   });
 }