Bug 1432037 - Wait for tab animation end when closing test tabs. r=bgrins

MozReview-Commit-ID: 2XxcOFOqJo

--HG--
extra : rebase_source : ae7482dc3ebc67285f6ca666804edb2819280ca8
This commit is contained in:
Alexandre Poirot 2018-02-06 06:26:49 -08:00
Родитель b9bc9a2583
Коммит 58e12beee8
1 изменённых файлов: 7 добавлений и 2 удалений

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

@ -278,8 +278,13 @@ Damp.prototype = {
});
},
closeCurrentTab() {
async closeCurrentTab() {
let onTransition = new Promise(done => {
this._win.gBrowser.tabContainer.addEventListener("transitionend", done,
{ once: true });
});
this._win.BrowserCloseTabOrWindow();
await onTransition;
return this._win.gBrowser.selectedTab;
},
@ -907,7 +912,7 @@ async _consoleOpenWithCachedMessagesTest() {
},
async testTeardown(url) {
this.closeCurrentTab();
await this.closeCurrentTab();
// Force freeing memory now so that it doesn't happen during the next test
await garbageCollect();