Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | // Test that asking for isLivemark in a annotationChanged notification |
michael@0 | 5 | // correctly returns true. |
michael@0 | 6 | function run_test() |
michael@0 | 7 | { |
michael@0 | 8 | do_test_pending(); |
michael@0 | 9 | |
michael@0 | 10 | let annoObserver = { |
michael@0 | 11 | onItemAnnotationSet: |
michael@0 | 12 | function AO_onItemAnnotationSet(aItemId, aAnnotationName) |
michael@0 | 13 | { |
michael@0 | 14 | if (aAnnotationName == PlacesUtils.LMANNO_FEEDURI) { |
michael@0 | 15 | PlacesUtils.annotations.removeObserver(this); |
michael@0 | 16 | PlacesUtils.livemarks.getLivemark({ id: aItemId }) |
michael@0 | 17 | .then(aLivemark => { |
michael@0 | 18 | PlacesUtils.bookmarks.removeItem(aItemId); |
michael@0 | 19 | do_test_finished(); |
michael@0 | 20 | }, do_throw); |
michael@0 | 21 | } |
michael@0 | 22 | }, |
michael@0 | 23 | |
michael@0 | 24 | onItemAnnotationRemoved: function () {}, |
michael@0 | 25 | onPageAnnotationSet: function() {}, |
michael@0 | 26 | onPageAnnotationRemoved: function() {}, |
michael@0 | 27 | QueryInterface: XPCOMUtils.generateQI([ |
michael@0 | 28 | Ci.nsIAnnotationObserver |
michael@0 | 29 | ]), |
michael@0 | 30 | } |
michael@0 | 31 | PlacesUtils.annotations.addObserver(annoObserver, false); |
michael@0 | 32 | PlacesUtils.livemarks.addLivemark( |
michael@0 | 33 | { title: "livemark title" |
michael@0 | 34 | , parentId: PlacesUtils.unfiledBookmarksFolderId |
michael@0 | 35 | , index: PlacesUtils.bookmarks.DEFAULT_INDEX |
michael@0 | 36 | , siteURI: uri("http://example.com/") |
michael@0 | 37 | , feedURI: uri("http://example.com/rdf") |
michael@0 | 38 | } |
michael@0 | 39 | ).then(null, do_throw); |
michael@0 | 40 | } |