mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
4e55362a90
Map the modules directory to services-sync instead of weave and update imports.
34 lines
957 B
JavaScript
34 lines
957 B
JavaScript
_("Make sure various combinations of anno arguments do the right get/set for pages/items");
|
|
Cu.import("resource://services-sync/util.js");
|
|
|
|
function run_test() {
|
|
_("set an anno on an item 1");
|
|
Utils.anno(1, "anno", "hi");
|
|
do_check_eq(Utils.anno(1, "anno"), "hi");
|
|
|
|
_("set an anno on a url");
|
|
Utils.anno("about:", "tation", "hello");
|
|
do_check_eq(Utils.anno("about:", "tation"), "hello");
|
|
|
|
_("make sure getting it also works with a nsIURI");
|
|
let uri = Utils.makeURI("about:");
|
|
do_check_eq(Utils.anno(uri, "tation"), "hello");
|
|
|
|
_("make sure annotations get updated");
|
|
Utils.anno(uri, "tation", "bye!");
|
|
do_check_eq(Utils.anno("about:", "tation"), "bye!");
|
|
|
|
_("sanity check that the item anno is still there");
|
|
do_check_eq(Utils.anno(1, "anno"), "hi");
|
|
|
|
_("invalid uris don't get annos");
|
|
let didThrow = false;
|
|
try {
|
|
Utils.anno("foo/bar/baz", "bad");
|
|
}
|
|
catch(ex) {
|
|
didThrow = true;
|
|
}
|
|
do_check_true(didThrow);
|
|
}
|