Bug 1254988, remove correct listener in waitForFocus, r=jmaher

This commit is contained in:
Neil Deakin 2016-03-11 08:50:22 -05:00
Родитель 877969d5e0
Коммит 895e698fb9
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -792,7 +792,7 @@ SimpleTest.waitForFocus = function (callback, targetWindow, expectBlankPage) {
if (isChildProcess) {
/* This message is used when an inner child frame must be focused. */
addMessageListener("WaitForFocus:FocusChild", function focusChild(msg) {
removeMessageListener("WaitForFocus:ChildFocused", focusChild);
removeMessageListener("WaitForFocus:FocusChild", focusChild);
finished = false;
waitForLoadAndFocusOnWindow(msg.objects.child);
});
@ -849,6 +849,7 @@ SimpleTest.waitForFocus = function (callback, targetWindow, expectBlankPage) {
}
else {
browser.messageManager.removeMessageListener("WaitForFocus:ChildFocused", waitTest);
SimpleTest._pendingWaitForFocusCount--;
setTimeout(callback, 0, browser ? browser.contentWindowAsCPOW : targetWindow);
}
});