Bug 1299642 - Fix docshell errors when breaking chrome -> chrome leaks. r=ted
authorEric Rahm <erahm@mozilla.com>
Thu, 15 Sep 2016 16:43:38 -0700
changeset 357686 1040858d0fb6e42de9f2d06bbb1daf800db7146a
parent 357685 d402fd4afc29021284779b8bd33d61980307ca08
child 357687 e3fa462347c8c863e310d4e0e45e470c9775bdcd
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1299642
milestone51.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 1299642 - Fix docshell errors when breaking chrome -> chrome leaks. r=ted It appears the lambda function passed to waitForFocus goes out of scope when the window is closed. Just pass in SimpleTest.finish directly instead.
docshell/test/chrome/docshell_helpers.js
--- a/docshell/test/chrome/docshell_helpers.js
+++ b/docshell/test/chrome/docshell_helpers.js
@@ -357,19 +357,17 @@ function finish() {
   let SimpleTest = opener.wrappedJSObject.SimpleTest;
 
   // Wait for the window to be closed before finishing the test
   let ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
 	             .getService(Components.interfaces.nsIWindowWatcher);
   ww.registerNotification(function(subject, topic, data) {
     if (topic == "domwindowclosed") {
       ww.unregisterNotification(arguments.callee);
-      SimpleTest.waitForFocus(function() {
-        SimpleTest.finish();
-      }, opener);
+      SimpleTest.waitForFocus(SimpleTest.finish, opener);
     }
   });
 
   window.close();
 }
 
 /**
  * Helper function which waits until another function returns true, or until a