Bug 1388149 - Make PlacesUtils.history.insertMany respect provided GUIDs r?markh
MozReview-Commit-ID: 7g6uABtHKg2
--- a/services/sync/tests/unit/test_history_store.js
+++ b/services/sync/tests/unit/test_history_store.js
@@ -132,16 +132,17 @@ add_task(async function test_store_creat
{id: tbguid,
histUri: tburi.spec,
title: "The bird is the word!",
visits: [{date: TIMESTAMP3,
type: Ci.nsINavHistoryService.TRANSITION_TYPED}]}
]);
await onVisitObserved;
try {
+ do_check_true((await store.itemExists(tbguid)));
do_check_attribute_count(await store.getAllIDs(), 2);
let queryres = queryHistoryVisits(tburi);
do_check_eq(queryres.length, 1);
do_check_eq(queryres[0].time, TIMESTAMP3);
do_check_eq(queryres[0].title, "The bird is the word!");
} catch (ex) {
PlacesTestUtils.clearHistory();
do_throw(ex);
--- a/toolkit/components/places/History.jsm
+++ b/toolkit/components/places/History.jsm
@@ -705,16 +705,17 @@ this.History = Object.freeze({
* Note: this assumes that the PageInfo object has already been validated
* via PlacesUtils.validatePageInfo.
*
* @param pageInfo: (PageInfo)
* @return (info)
*/
function convertForUpdatePlaces(pageInfo) {
let info = {
+ guid: pageInfo.guid,
uri: PlacesUtils.toURI(pageInfo.url),
title: pageInfo.title,
visits: [],
};
for (let inVisit of pageInfo.visits) {
let visit = {
visitDate: PlacesUtils.toPRTime(inVisit.date),