Bug 1116457, attach the focus event listener to the right child window, r=jmaher
authorNeil Deakin <neil@mozilla.com>
Wed, 07 Jan 2015 20:52:20 -0500
changeset 222586 83f3a7efed212ef4e7d1acf58cccce2e91f44880
parent 222585 bb5356f6a251c4493ebd985cc9dfd815fd689871
child 222587 6d8e998d62122ef75626c0889f9185977b229cc1
push id28068
push usercbook@mozilla.com
push dateThu, 08 Jan 2015 13:16:34 +0000
treeherdermozilla-central@2880e05d5e32 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1116457
milestone37.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 1116457, attach the focus event listener to the right child window, r=jmaher
testing/mochitest/tests/SimpleTest/SimpleTest.js
--- a/testing/mochitest/tests/SimpleTest/SimpleTest.js
+++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js
@@ -782,17 +782,17 @@ SimpleTest.waitForFocus = function (call
           } else {
               childDesiredWindow = SpecialPowers.getFocusedElementForWindow(desiredWindow, true);
           }
 
           /* If this is a child frame, ensure that the frame is focused. */
           focused = (focusedWindow() == childDesiredWindow);
           if (!focused) {
               info("must wait for focus");
-              desiredWindow.addEventListener("focus", focusedOrLoaded, true);
+              childDesiredWindow.addEventListener("focus", focusedOrLoaded, true);
               if (isChildProcess) {
                   childDesiredWindow.focus();
               }
               else {
                   SpecialPowers.focus(childDesiredWindow);
               }
           }