mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 521233 - waitForFocus(callback) times out in browser chrome tests. use it in browser_bug304198.js, r=enn
This commit is contained in:
parent
5ea0a853b4
commit
cc70be0e78
@ -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;
|
||||
|
@ -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");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user