зеркало из https://github.com/mozilla/pjs.git
Bug 521282 - Make sure the browser window is focused before each test. r=mano
This commit is contained in:
Родитель
516a819935
Коммит
36736379e9
|
@ -38,10 +38,6 @@
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
waitForFocus(continue_test);
|
||||
}
|
||||
|
||||
function continue_test() {
|
||||
let charsToDelete, deletedURLTab, fullURLTab, partialURLTab, testPartialURL, testURL;
|
||||
|
||||
charsToDelete = 5;
|
||||
|
|
|
@ -1,13 +1,4 @@
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
if (Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager).activeWindow !=
|
||||
window) {
|
||||
setTimeout(test, 0);
|
||||
window.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
gPrefService.setBoolPref("browser.ctrlTab.previews", true);
|
||||
|
||||
gBrowser.addTab();
|
||||
|
@ -87,8 +78,6 @@ function test() {
|
|||
if (gPrefService.prefHasUserValue("browser.ctrlTab.previews"))
|
||||
gPrefService.clearUserPref("browser.ctrlTab.previews");
|
||||
|
||||
finish();
|
||||
|
||||
/* private utility functions */
|
||||
|
||||
function pressCtrlTab(aShiftKey)
|
||||
|
|
|
@ -10,14 +10,7 @@ var gTabMoveCount = 0;
|
|||
var gPageLoadCount = 0;
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
if (Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager).activeWindow !=
|
||||
window) {
|
||||
setTimeout(test, 0);
|
||||
window.focus();
|
||||
return;
|
||||
}
|
||||
waitForExplicitFinish();
|
||||
|
||||
var windows = Application.windows;
|
||||
ok(windows, "Check access to browser windows");
|
||||
|
|
|
@ -109,6 +109,21 @@ Tester.prototype = {
|
|||
return;
|
||||
}
|
||||
|
||||
// Make sure the window is raised before each test.
|
||||
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
|
||||
if (fm.activeWindow != window) {
|
||||
this.dumper.dump("Waiting for window activation...\n");
|
||||
let self = this;
|
||||
window.addEventListener("activate", function () {
|
||||
window.removeEventListener("activate", arguments.callee, false);
|
||||
setTimeout(function () {
|
||||
self.execTest();
|
||||
}, 0);
|
||||
}, false);
|
||||
window.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
// Move to the next test (or first test).
|
||||
this.step();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче