michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: // Test that asking for isLivemark in a annotationChanged notification michael@0: // correctly returns true. michael@0: function run_test() michael@0: { michael@0: do_test_pending(); michael@0: michael@0: let annoObserver = { michael@0: onItemAnnotationSet: michael@0: function AO_onItemAnnotationSet(aItemId, aAnnotationName) michael@0: { michael@0: if (aAnnotationName == PlacesUtils.LMANNO_FEEDURI) { michael@0: PlacesUtils.annotations.removeObserver(this); michael@0: PlacesUtils.livemarks.getLivemark({ id: aItemId }) michael@0: .then(aLivemark => { michael@0: PlacesUtils.bookmarks.removeItem(aItemId); michael@0: do_test_finished(); michael@0: }, do_throw); michael@0: } michael@0: }, michael@0: michael@0: onItemAnnotationRemoved: function () {}, michael@0: onPageAnnotationSet: function() {}, michael@0: onPageAnnotationRemoved: function() {}, michael@0: QueryInterface: XPCOMUtils.generateQI([ michael@0: Ci.nsIAnnotationObserver michael@0: ]), michael@0: } michael@0: PlacesUtils.annotations.addObserver(annoObserver, false); michael@0: PlacesUtils.livemarks.addLivemark( michael@0: { title: "livemark title" michael@0: , parentId: PlacesUtils.unfiledBookmarksFolderId michael@0: , index: PlacesUtils.bookmarks.DEFAULT_INDEX michael@0: , siteURI: uri("http://example.com/") michael@0: , feedURI: uri("http://example.com/rdf") michael@0: } michael@0: ).then(null, do_throw); michael@0: }