Bug 1266134 - Wait for window close before ending test in browser_styleeditor_private_perwindowpb.js. r=jryans

MozReview-Commit-ID: 65WEA8goOP5

--HG--
extra : rebase_source : 2db41fb4bb9d86f8064739453354c55a09b76cd8
This commit is contained in:
Alexandre Poirot 2016-09-12 03:20:52 -07:00
Родитель eb9db5ddc0
Коммит 7c35371232
1 изменённых файлов: 13 добавлений и 1 удалений

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

@ -22,14 +22,26 @@ add_task(function* () {
info("Clearing the browser cache");
cache.clear();
let { ui } = yield openStyleEditorForURL(TEST_URL, win);
let { toolbox, ui } = yield openStyleEditorForURL(TEST_URL, win);
is(ui.editors.length, 1, "The style editor contains one sheet.");
let editor = ui.editors[0];
yield editor.getSourceEditor();
yield checkDiskCacheFor(TEST_HOST);
yield toolbox.destroy();
let onUnload = new Promise(done => {
win.addEventListener("unload", function listener(event) {
if (event.target == win.document) {
win.removeEventListener("unload", listener);
done();
}
});
});
win.close();
yield onUnload;
});
function checkDiskCacheFor(host) {