зеркало из https://github.com/mozilla/pjs.git
Bug 753273 - Wait for window and browser at the start of newSession, r=mdas, a=test-only, DONTBUILD because NPOTB
This commit is contained in:
Родитель
44cba3b4db
Коммит
20f2b59ecf
|
@ -336,8 +336,21 @@ MarionetteDriverActor.prototype = {
|
|||
*
|
||||
*/
|
||||
newSession: function MDA_newSession() {
|
||||
|
||||
function waitForWindow() {
|
||||
let checkTimer = Cc["@mozilla.org/timer;1"].
|
||||
createInstance(Ci.nsITimer);
|
||||
let win = this.getCurrentWindow();
|
||||
if (!win || (appName != "B2G" && !win.gBrowser)) {
|
||||
checkTimer.initWithCallback(waitForWindow.bind(this), 100, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
}
|
||||
else {
|
||||
this.startBrowser(win, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!prefs.getBoolPref("marionette.contentListener")) {
|
||||
this.startBrowser(this.getCurrentWindow(), true);
|
||||
waitForWindow.call(this);
|
||||
}
|
||||
else if ((appName == "B2G") && (this.curBrowser == null)) {
|
||||
//if there is a content listener, then we just wake it up
|
||||
|
|
Загрузка…
Ссылка в новой задаче