Bug 1675248 - [marionette] Don't wait for Marionette:ListenersAttached in openTab(). r=marionette-reviewers,maja_zf

This code doesn't seem to be necessary anymore, and can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D96111
This commit is contained in:
Henrik Skupin 2020-11-06 20:12:58 +00:00
Родитель 5f60b0fd71
Коммит cbcf8dca60
1 изменённых файлов: 3 добавлений и 23 удалений

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

@ -390,32 +390,12 @@ browser.Context = class {
switch (this.driver.appName) {
case "firefox":
const loaded = [waitForEvent(this.window, "TabOpen")];
const opened = waitForEvent(this.window, "TabOpen");
this.window.BrowserOpenTab();
await opened;
tab = this.tabBrowser.selectedTab;
// wait until the framescript has been registered
loaded.push(
new Promise(resolve => {
let cb = msg => {
if (msg.json.frameId === tab.linkedBrowser.browsingContext.id) {
this.driver.mm.removeMessageListener(
"Marionette:ListenersAttached",
cb
);
resolve();
}
};
this.driver.mm.addMessageListener(
"Marionette:ListenersAttached",
cb
);
})
);
await Promise.all(loaded);
// The new tab is always selected by default. If focus is not wanted,
// the previously tab needs to be selected again.
if (!focus) {