Bug 1447513 - Make sure we sync at the start of test_history_collision phase 2 r?markh draft
authorThom Chiovoloni <tchiovoloni@mozilla.com>
Tue, 20 Mar 2018 17:17:12 -0700
changeset 770329 d9b1288883208a9f1d9280f102b20c4e74f82a76
parent 769888 827c686c570935483c3ad8022aa92b9e005574c3
push id103380
push userbmo:tchiovoloni@mozilla.com
push dateWed, 21 Mar 2018 00:18:23 +0000
reviewersmarkh
bugs1447513
milestone61.0a1
Bug 1447513 - Make sure we sync at the start of test_history_collision phase 2 r?markh This patch also improves the DumpHistory logging to make it include GUIDs. MozReview-Commit-ID: 9X3YLe8mnwW
services/sync/tests/tps/test_history_collision.js
services/sync/tps/extensions/tps/resource/modules/history.jsm
--- a/services/sync/tests/tps/test_history_collision.js
+++ b/services/sync/tests/tps/test_history_collision.js
@@ -99,16 +99,17 @@ var history_after_delete = [
  */
 
 Phase("phase1", [
   [History.add, history1],
   [Sync]
 ]);
 
 Phase("phase2", [
+  [Sync],
   [History.add, history1],
   [Sync, SYNC_WIPE_REMOTE]
 ]);
 
 Phase("phase3", [
   [Sync],
   [History.verify, history1],
   [History.delete, history_to_delete],
--- a/services/sync/tps/extensions/tps/resource/modules/history.jsm
+++ b/services/sync/tps/extensions/tps/resource/modules/history.jsm
@@ -18,19 +18,20 @@ var DumpHistory = async function TPS_His
   let query = PlacesUtils.history.getNewQuery();
   let options = PlacesUtils.history.getNewQueryOptions();
   let root = PlacesUtils.history.executeQuery(query, options).root;
   root.containerOpen = true;
   Logger.logInfo("\n\ndumping history\n", true);
   for (var i = 0; i < root.childCount; i++) {
     let node = root.getChild(i);
     let uri = node.uri;
+    let guid = await PlacesSyncUtils.history.fetchGuidForURL(uri).catch(() => "?".repeat(12));
     let curvisits = await PlacesSyncUtils.history.fetchVisitsForURL(uri);
     for (var visit of curvisits) {
-      Logger.logInfo("URI: " + uri + ", type=" + visit.type + ", date=" + visit.date, true);
+      Logger.logInfo(`GUID: ${guid}, URI: ${uri}, type=${visit.type}, date=${visit.date}`, true);
     }
   }
   root.containerOpen = false;
   Logger.logInfo("\nend history dump\n", true);
 };
 
 /**
  * HistoryEntry object