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-19 22:54:00 +00:00
Родитель 72dedae18c
Коммит 247e65743f
2 изменённых файлов: 3 добавлений и 4 удалений

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

@ -1153,6 +1153,9 @@ GeckoDriver.prototype.navigateTo = async function(cmd) {
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({
url: validURL.spec,
pageTimeout: this.timeouts.pageLoad,

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

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