Bug 1158887 - Intermittent test_async_transactions.js. r=mak

This commit is contained in:
Asaf Romano 2015-05-29 12:36:52 +02:00
parent b1edd1f199
commit 2475a5dbb4
2 changed files with 9 additions and 4 deletions

View File

@ -208,8 +208,7 @@ LivemarkService.prototype = {
title: aLivemarkInfo.title,
index: aLivemarkInfo.index,
guid: aLivemarkInfo.guid,
dateAdded: toDate(aLivemarkInfo.dateAdded) || toDate(aLivemarkInfo.lastModified),
lastModified: toDate(aLivemarkInfo.lastModified),
dateAdded: toDate(aLivemarkInfo.dateAdded) || toDate(aLivemarkInfo.lastModified)
});
// Set feed and site URI annotations.
@ -233,6 +232,12 @@ LivemarkService.prototype = {
livemark.writeSiteURI(aLivemarkInfo.siteURI);
}
if (aLivemarkInfo.lastModified) {
yield PlacesUtils.bookmarks.update({ guid: folder.guid,
lastModified: toDate(aLivemarkInfo.lastModified) });
livemark.lastModified = aLivemarkInfo.lastModified;
}
livemarksMap.set(folder.guid, livemark);
return livemark;

View File

@ -190,6 +190,7 @@ add_task(function* test_addLivemark_noSiteURI_succeeds() {
do_check_true(livemark.feedURI.equals(FEED_URI));
do_check_eq(livemark.siteURI, null);
do_check_true(livemark.lastModified > 0);
do_check_true(is_time_ordered(livemark.dateAdded, livemark.lastModified));
let bookmark = yield PlacesUtils.bookmarks.fetch(livemark.guid);
do_check_eq(livemark.index, bookmark.index);
@ -303,8 +304,7 @@ add_task(function* test_addLivemark_lastModified_succeeds() {
, lastModified: now
});
do_check_eq(livemark.dateAdded, now);
// lastModified is updated when annotations are added to the livemark.
do_check_true(is_time_ordered(now, livemark.lastModified));
do_check_eq(livemark.lastModified, now);
});
add_task(function* test_removeLivemark_emptyObject_throws() {