Bug 1398111 - [marionette] Update mainFrame and curFrame when switching chrome windows. r=ato

When switching between chrome windows Marionette doesn't update
its references for the mainFrame (current chrome window) and
curFrame (current frame inside the chrome window). Instead it
gets currently only updated when a new chrome window opens.

It means that in most cases Marionette sets the focus on the
wrong chrome window and frame.

--HG--
extra : rebase_source : 3aebd6a15e46f183b32f4d7cf6727ef6c370f6f3
This commit is contained in:
Henrik Skupin 2018-06-07 08:51:27 +02:00
parent 80120fa560
commit 0e52e2a27a

View File

@ -1620,10 +1620,12 @@ GeckoDriver.prototype.setWindowHandle = async function(
}
} else {
// Otherwise switch to the known chrome window, and activate the tab
// if it's a content browser.
// Otherwise switch to the known chrome window
this.curBrowser = this.browsers[winProperties.outerId];
this.mainFrame = this.curBrowser.window;
this.curFrame = null;
// .. and activate the tab if it's a content browser.
if ("tabIndex" in winProperties) {
this.curBrowser.switchToTab(
winProperties.tabIndex, winProperties.win, focus);