Bug 1163418 - Remove use of CPOWs in browser_bookmark_titles.js. r=felipe

This commit is contained in:
Blake Kaplan 2016-06-09 14:51:46 -07:00
parent eb98b5c082
commit 65c8df357c

View File

@ -86,16 +86,11 @@ function* checkBookmark(uri, expected_title) {
// custom page load listener.
function promisePageLoaded(browser)
{
return new Promise(resolve => {
browser.addEventListener("DOMContentLoaded", function pageLoaded(event) {
browser.removeEventListener("DOMContentLoaded", pageLoaded, true);
if (event.originalTarget != browser.contentDocument ||
event.target.location.href == "about:blank") {
info("skipping spurious load event");
return;
}
resolve();
}, true);
return ContentTask.spawn(browser, null, function* () {
yield ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", true,
(event) => {
return event.originalTarget === content.document &&
event.target.location.href !== "about:blank"
});
});
}