From e6256c9f1ace5f98d1251e0d16c3cf6783ff3564 Mon Sep 17 00:00:00 2001 From: Eric Rahm Date: Thu, 15 Sep 2016 16:43:38 -0700 Subject: [PATCH] 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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docshell/test/chrome/docshell_helpers.js b/docshell/test/chrome/docshell_helpers.js index c7eebe13d1ac..2d55e5a6e039 100755 --- a/docshell/test/chrome/docshell_helpers.js +++ b/docshell/test/chrome/docshell_helpers.js @@ -362,9 +362,7 @@ function finish() { ww.registerNotification(function(subject, topic, data) { if (topic == "domwindowclosed") { ww.unregisterNotification(arguments.callee); - SimpleTest.waitForFocus(function() { - SimpleTest.finish(); - }, opener); + SimpleTest.waitForFocus(SimpleTest.finish, opener); } });