Bug 521233 - waitForFocus(callback) times out in browser chrome tests. use it in browser_bug304198.js, r=enn

This commit is contained in:
Marco Bonardo 2009-10-28 17:22:59 +01:00
parent 5ea0a853b4
commit cc70be0e78
2 changed files with 7 additions and 6 deletions

View File

@ -38,13 +38,10 @@
function test() {
waitForExplicitFinish();
if (Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager).activeWindow !=
window) {
setTimeout(test, 0);
window.focus();
return;
}
waitForFocus(continue_test);
}
function continue_test() {
let charsToDelete, deletedURLTab, fullURLTab, partialURLTab, testPartialURL, testURL;
charsToDelete = 5;

View File

@ -238,6 +238,10 @@ SimpleTest.waitForFocus = function (callback, targetWindow) {
var fm = Components.classes["@mozilla.org/focus-manager;1"].
getService(Components.interfaces.nsIFocusManager);
var usedTargetWindow = {};
fm.getFocusedElementForWindow(targetWindow, true, usedTargetWindow);
targetWindow = usedTargetWindow.value;
function debugFocusLog(prefix) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");