зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
5f60b0fd71
Коммит
cbcf8dca60
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче