Bug 1280357 - Update browser.history.onVisited to not call PlacesUtils.promisePlaceInfo, r=kmag

MozReview-Commit-ID: 3j4JdWI6APu

--HG--
extra : transplant_source : %B0ir%3B%FF%08%1A%08%D8%DDa%C1%90%AD%03%97M%DA%E3%FC
This commit is contained in:
Bob Silverberg 2016-07-19 17:01:08 -04:00
Родитель 64528a4fed
Коммит 55401c8180
2 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -99,17 +99,15 @@ function getObserver() {
this.emit("visitRemoved", {allHistory: false, urls: [uri.spec]});
},
onVisit: function(uri, visitId, time, sessionId, referringId, transitionType, guid, hidden, visitCount, typed) {
PlacesUtils.promisePlaceInfo(guid).then(placeInfo => {
let data = {
id: guid,
url: uri.spec,
title: placeInfo.title,
lastVisitTime: time / 1000, // time from Places is microseconds,
visitCount,
typedCount: typed,
};
this.emit("visited", data);
});
let data = {
id: guid,
url: uri.spec,
title: "",
lastVisitTime: time / 1000, // time from Places is microseconds,
visitCount,
typedCount: typed,
};
this.emit("visited", data);
},
onBeginUpdateBatch: function() {},
onEndUpdateBatch: function() {},

Просмотреть файл

@ -459,7 +459,9 @@ add_task(function* test_on_visited() {
let onVisited = onVisitedData[index];
ok(PlacesUtils.isValidGuid(onVisited.id), "onVisited received a valid id");
is(onVisited.url, expected.url, "onVisited received the expected url");
is(onVisited.title, expected.title, "onVisited received the expected title");
// Title will be blank until bug 1287928 lands
// https://bugzilla.mozilla.org/show_bug.cgi?id=1287928
is(onVisited.title, "", "onVisited received a blank title");
is(onVisited.lastVisitTime, expected.time, "onVisited received the expected time");
is(onVisited.visitCount, expected.visitCount, "onVisited received the expected visitCount");
}