зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1817820 - [marionette] Retry switch to frame if browsing context changed mid flight r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D208638
This commit is contained in:
Родитель
e2ed9b1410
Коммит
6bda69a738
|
@ -1373,9 +1373,20 @@ GeckoDriver.prototype.switchToFrame = async function (cmd) {
|
|||
byFrame = el;
|
||||
}
|
||||
|
||||
const { browsingContext } = await this.getActor({ top }).switchToFrame(
|
||||
byFrame || id
|
||||
);
|
||||
// If the current context changed during the switchToFrame call, attempt to
|
||||
// call switchToFrame again until the browsing context remains stable.
|
||||
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1786640#c11
|
||||
let browsingContext;
|
||||
for (let i = 0; i < 5; i++) {
|
||||
const currentBrowsingContext = this.currentSession.contentBrowsingContext;
|
||||
({ browsingContext } = await this.getActor({ top }).switchToFrame(
|
||||
byFrame || id
|
||||
));
|
||||
|
||||
if (currentBrowsingContext == this.currentSession.contentBrowsingContext) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.currentSession.contentBrowsingContext = browsingContext;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче