Bug 1612831 - [marionette] Switch to top-level frame before checking current URL. r=marionette-reviewers,maja_zf

The navigation command is always executed on the top-level
browsing context. As such the check for a possible load
event should not be done for the currently selected frame.

At the same time the switch to frame call can be moved
to the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D80619
This commit is contained in:
Henrik Skupin 2020-07-18 14:06:41 +00:00
Родитель 8763d1f577
Коммит e64bbc774d
2 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -1153,6 +1153,9 @@ GeckoDriver.prototype.navigateTo = async function(cmd) {
throw new InvalidArgumentError(`Malformed URL: ${e.message}`); throw new InvalidArgumentError(`Malformed URL: ${e.message}`);
} }
// We need to move to the top frame before navigating
await this.listener.switchToFrame();
const navigated = this.listener.navigateTo({ const navigated = this.listener.navigateTo({
url: validURL.spec, url: validURL.spec,
pageTimeout: this.timeouts.pageLoad, pageTimeout: this.timeouts.pageLoad,

Просмотреть файл

@ -1133,10 +1133,6 @@ function navigateTo(msg) {
url url
); );
// We need to move to the top frame before navigating
sendSyncMessage("Marionette:switchedToFrame", { frameValue: null });
curContainer.frame = content;
loadListener.navigate( loadListener.navigate(
() => { () => {
curContainer.frame.location = url; curContainer.frame.location = url;