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
--- 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