Bug 1398111 - [marionette] Update mainFrame and curFrame when switching chrome windows.
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 only done right now when a new chrome window opens.
It means that in most cases Marionette operates on the wrong
chrome window and frame.
MozReview-Commit-ID: ChwzGguWurx
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -1627,20 +1627,22 @@ GeckoDriver.prototype.setWindowHandle =
this.startBrowser(winProperties.win, false /* isNewSession */);
if (registerBrowsers && browserListening) {
await registerBrowsers;
await browserListening;
}
} 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);
}
}
};
GeckoDriver.prototype.getActiveFrame = function() {