Bug 1358368 - Ensure we read values from a current db snapshot in places/tests/favicons/test_root_icons.js. r=standard8
MozReview-Commit-ID: CQfLhymN0Fz
--- a/toolkit/components/places/tests/favicons/test_root_icons.js
+++ b/toolkit/components/places/tests/favicons/test_root_icons.js
@@ -75,17 +75,23 @@ add_task(function* test_removePagesByTim
Assert.equal(rows.length, 1, "There should only be 1 icon entry");
Assert.equal(rows[0].getResultByName("root"), 1, "It should be marked as a root icon");
rows = yield db.execute("SELECT * FROM moz_pages_w_icons");
Assert.equal(rows.length, 0, "There should be no page entry");
rows = yield db.execute("SELECT * FROM moz_icons_to_pages");
Assert.equal(rows.length, 0, "There should be no relation entry");
PlacesUtils.history.removePagesByTimeframe(0, PlacesUtils.toPRTime(new Date()));
+ yield PlacesTestUtils.promiseAsyncUpdates();
rows = yield db.execute("SELECT * FROM moz_icons");
+ // Debug logging for possible intermittent failure (bug 1358368).
+ if (rows.length != 0) {
+ dump_table("moz_icons");
+ dump_table("moz_hosts");
+ }
Assert.equal(rows.length, 0, "There should be no icon entry");
});
add_task(function* test_different_host() {
let pageURI = NetUtil.newURI("http://places.test/page/");
yield PlacesTestUtils.addVisits(pageURI);
let faviconURI = NetUtil.newURI("http://mozilla.test/favicon.ico");
PlacesUtils.favicons.replaceFaviconDataFromDataURL(