blob: a7ad1257adef2a4e7fe80da218b0ceb8bf547314 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// Test that asking for a livemark in a annotationChanged notification works.
add_task(function* () {
let annoPromise = new Promise(resolve => {
let annoObserver = {
onItemAnnotationSet(id, name) {
if (name == PlacesUtils.LMANNO_FEEDURI) {
PlacesUtils.annotations.removeObserver(this);
resolve();
}
},
onItemAnnotationRemoved() {},
onPageAnnotationSet() {},
onPageAnnotationRemoved() {},
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIAnnotationObserver
]),
};
PlacesUtils.annotations.addObserver(annoObserver, false);
});
let livemark = yield PlacesUtils.livemarks.addLivemark(
{ title: "livemark title"
, parentGuid: PlacesUtils.bookmarks.unfiledGuid
, index: PlacesUtils.bookmarks.DEFAULT_INDEX
, siteURI: uri("http://example.com/")
, feedURI: uri("http://example.com/rdf")
});
yield annoPromise;
livemark = yield PlacesUtils.livemarks.getLivemark({ guid: livemark.guid });
Assert.ok(livemark);
yield PlacesUtils.livemarks.removeLivemark({ guid: livemark.guid });
});
|