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 248412 83f3a7efed212ef4e7d1acf58cccce2e91f44880
parent 248411 bb5356f6a251c4493ebd985cc9dfd815fd689871
child 248413 6d8e998d62122ef75626c0889f9185977b229cc1
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [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);
               }
           }