tagssvc.tagURI(uri1, ["tag 1"], 1); tagssvc.tagURI(uri2, ["tag 1"], 1); 
tagssvc.tagURI(uri1, ["tag 1"]); tagssvc.tagURI(uri2, ["tag 1"]); 
function run_test() {  var options = histsvc.getNewQueryOptions();  var query = histsvc.getNewQuery();  query.setFolders([bmsvc.tagRoot], 1);  var result = histsvc.executeQuery(query, options);  var tagRoot = result.root;  tagRoot.containerOpen = true;  do_check_eq(tagRoot.childCount, 0);  var uri1 = uri("http://foo.tld/");  var uri2 = uri("https://bar.tld/");  // this also tests that the multiple folders are not created for the same tag  tagssvc.tagURI(uri1, ["tag 1"], 1);  tagssvc.tagURI(uri2, ["tag 1"], 1);  do_check_eq(tagRoot.childCount, 1);  var tag1node = tagRoot.getChild(0)                        .QueryInterface(Ci.nsINavHistoryContainerResultNode);  do_check_eq(tag1node.title, "tag 1");  tag1node.containerOpen = true;  do_check_eq(tag1node.childCount, 2);  // Tagging the same url twice with the same tag should be a no-op  tagssvc.tagURI(uri1, ["tag 1"], 1);  do_check_eq(tag1node.childCount, 2);  // the former should be ignored.  do_check_eq(tagRoot.childCount, 1);  tagssvc.tagURI(uri1, ["tag 1", "tag 2"], 2);  do_check_eq(tagRoot.childCount, 2);  // test getTagsForURI  var uri1tags = tagssvc.getTagsForURI(uri1, {});  do_check_eq(uri1tags.length, 2);  do_check_eq(uri1tags[0], "tag 1");  do_check_eq(uri1tags[1], "tag 2");  var uri2tags = tagssvc.getTagsForURI(uri2, {});  do_check_eq(uri2tags.length, 1);  do_check_eq(uri2tags[0], "tag 1");  // test getURIsForTag  var tag1uris = tagssvc.getURIsForTag("tag 1");  do_check_eq(tag1uris.length, 2);  do_check_true(tag1uris[0].equals(uri1));  do_check_true(tag1uris[1].equals(uri2));  tagssvc.untagURI(uri1, ["tag 1"], 1);  do_check_eq(tag1node.childCount, 1);  // removing the last uri from a tag should remove the tag-container  tagssvc.untagURI(uri2, ["tag 1"], 1);  do_check_eq(tagRoot.childCount, 1);}
5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5872/1bfb840f8e39cdb28f2b8ef5c64952475bdd03ca/test_tagging.js/buggy/toolkit/components/places/tests/unit/test_tagging.js