mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 621594 - History sync: failure when title is null. r=mconnor
This commit is contained in:
parent
4cb107444e
commit
0f15591bbb
@ -427,7 +427,9 @@ HistoryStore.prototype = {
|
||||
if (curvisits.every(function(cur) cur.date != date))
|
||||
Svc.History.addVisit(uri, date, null, type, type == 5 || type == 6, 0);
|
||||
|
||||
this._hsvc.setPageTitle(uri, record.title);
|
||||
if (record.title) {
|
||||
this._hsvc.setPageTitle(uri, record.title);
|
||||
}
|
||||
},
|
||||
|
||||
itemExists: function HistStore_itemExists(id) {
|
||||
|
@ -129,6 +129,22 @@ function run_test() {
|
||||
visits: [{date: TIMESTAMP3,
|
||||
type: Ci.nsINavHistoryService.TRANSITION_TYPED}]});
|
||||
|
||||
}, function (next) {
|
||||
|
||||
_("Make sure we handle a null title gracefully (it can happen in some cases, e.g. for resource:// URLs)");
|
||||
let resguid = Utils.makeGUID();
|
||||
let resuri = Utils.makeURI("unknown://title");
|
||||
store.create({id: resguid,
|
||||
histUri: resuri.spec,
|
||||
title: null,
|
||||
visits: [{date: TIMESTAMP3,
|
||||
type: Ci.nsINavHistoryService.TRANSITION_TYPED}]});
|
||||
do_check_eq([id for (id in store.getAllIDs())].length, 3);
|
||||
let queryres = queryHistoryVisits(resuri);
|
||||
do_check_eq(queryres.length, 1);
|
||||
do_check_eq(queryres[0].time, TIMESTAMP3);
|
||||
next();
|
||||
|
||||
}, function (next) {
|
||||
|
||||
_("Make sure we handle invalid URLs in places databases gracefully.");
|
||||
@ -138,7 +154,7 @@ function run_test() {
|
||||
+ "VALUES ('invalid-uri', 'Invalid URI', '.', 1, " + TIMESTAMP3 + ")";
|
||||
let stmt = Utils.createStatement(Svc.History.DBConnection, query);
|
||||
let result = Utils.queryAsync(stmt);
|
||||
do_check_eq([id for (id in store.getAllIDs())].length, 3);
|
||||
do_check_eq([id for (id in store.getAllIDs())].length, 4);
|
||||
|
||||
_("Remove a record from the store.");
|
||||
store.remove({id: fxguid});
|
||||
|
Loading…
Reference in New Issue
Block a user