зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1335801 - Wait for the right events. r=Felipe,krizsa
MozReview-Commit-ID: JL0AdE8XB2n --HG-- extra : rebase_source : ad6392315710cea34e583a9cabfc878ee225f186
This commit is contained in:
Родитель
b83ba23582
Коммит
8ede39135a
|
@ -140,19 +140,7 @@ function delayedStartupFinished(aWindow) {
|
|||
* @resolves With the tab once it's loaded.
|
||||
*/
|
||||
function someTabLoaded(aWindow) {
|
||||
return new Promise(function(resolve) {
|
||||
aWindow.gBrowser.addEventListener("load", function onLoad(aEvent) {
|
||||
if (aWindow.location.href === "about:blank") {
|
||||
return;
|
||||
}
|
||||
let tab = aWindow.gBrowser._getTabForContentWindow(
|
||||
aEvent.target.defaultView.top);
|
||||
if (tab) {
|
||||
aWindow.gBrowser.removeEventListener("load", onLoad, true);
|
||||
resolve(tab);
|
||||
}
|
||||
}, true);
|
||||
});
|
||||
return BrowserTestUtils.waitForNewTab(aWindow.gBrowser);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче