Bug 1358368 - Ensure we read values from a current db snapshot in places/tests/favicons/test_root_icons.js. r=standard8 draft
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 21 Apr 2017 12:18:16 +0200
changeset 566387 a7559df0a6c5432c3ed0329e2411dc41f6942498
parent 566156 8b854986038cf3f3f240697e27ef48ea65914c13
child 625291 b67f8bec8952f271585b800677c81981e8551265
push id55190
push usermak77@bonardo.net
push dateFri, 21 Apr 2017 10:21:20 +0000
reviewersstandard8
bugs1358368
milestone55.0a1
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
toolkit/components/places/tests/favicons/test_root_icons.js
--- 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(