rem: var removedBookmark = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, uri("http: bmsvc.removeItem(removedBookmark); do_check_eq(removedBookmark, viewer.removedItem.itemId); 
add: bmsvc.removeItem(testBookmark2); do_check_eq(testBookmark2, viewer.removedItem.itemId); 
context: function run_test() {  // history query  var options = histsvc.getNewQueryOptions();  options.sortingMode = options.SORT_BY_DATE_DESCENDING;  options.resultType = options.RESULTS_AS_VISIT;  var query = histsvc.getNewQuery();  var result = histsvc.executeQuery(query, options);  result.viewer = viewer;  var root = result.root;  root.containerOpen = true;  // nsINavHistoryResultViewer.containerOpened  do_check_neq(viewer.openedContainer, null);  // nsINavHistoryResultViewer.itemInserted  // add a visit  var testURI = uri("http://mozilla.com");  add_visit(testURI);  do_check_eq(testURI.spec, viewer.insertedItem.uri);  // nsINavHistoryResultViewer.itemChanged  // adding a visit causes itemChanged for the folder  do_check_eq(root.uri, viewer.changedItem.uri);  // nsINavHistoryResultViewer.itemChanged for a leaf node  bhist.addPageWithDetails(testURI, "baz", Date.now());  do_check_eq(viewer.changedItem.title, "baz");  // nsINavHistoryResultViewer.itemRemoved  var removedURI = uri("http://google.com");  add_visit(removedURI);  bhist.removePage(removedURI);  do_check_eq(removedURI.spec, viewer.removedItem.uri);  // XXX nsINavHistoryResultViewer.itemReplaced  // NHQRN.onVisit()->NHCRN.MergeResults()->NHCRN.ReplaceChildURIAt()->NHRV.ItemReplaced()  // nsINavHistoryResultViewer.invalidateContainer  bhist.removePagesFromHost("mozilla.com", false);  do_check_eq(root.uri, viewer.invalidatedContainer.uri);  // nsINavHistoryResultViewer.invalidateAll  // nsINavHistoryResultViewer.sortingChanged  result.sortingMode = options.SORT_BY_TITLE_ASCENDING;  do_check_true(viewer.allInvalidated);  do_check_eq(viewer.sortingMode, options.SORT_BY_TITLE_ASCENDING);  // nsINavHistoryResultViewer.containerClosed  root.containerOpen = false;  do_check_eq(viewer.closedContainer, viewer.openedContainer);  result.viewer = null;  // bookmarks query    // reset the viewer  viewer.reset();  try {    var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Ci.nsINavBookmarksService);  } catch(ex) {    do_throw("Could not get nav-bookmarks-service\n");  }  var options = histsvc.getNewQueryOptions();  var query = histsvc.getNewQuery();  query.setFolders([bmsvc.bookmarksMenuFolder], 1);  var result = histsvc.executeQuery(query, options);  result.viewer = viewer;  var root = result.root;  root.containerOpen = true;  // nsINavHistoryResultViewer.containerOpened  do_check_neq(viewer.openedContainer, null);  // nsINavHistoryResultViewer.itemInserted  // add a bookmark  var testBookmark = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, testURI, bmsvc.DEFAULT_INDEX, "foo");  do_check_eq("foo", viewer.insertedItem.title);  do_check_eq(testURI.spec, viewer.insertedItem.uri);  // nsINavHistoryResultViewer.itemChanged  // adding a visit causes itemChanged for the folder  do_check_eq(root.uri, viewer.changedItem.uri);  // nsINavHistoryResultViewer.itemChanged for a leaf node  bmsvc.setItemTitle(testBookmark, "baz");  do_check_eq(viewer.changedItem.title, "baz");  // nsINavHistoryResultViewer.itemRemoved  var removedBookmark = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, uri("http://google.com"), bmsvc.DEFAULT_INDEX, "foo");  bmsvc.removeItem(removedBookmark);  do_check_eq(removedBookmark, viewer.removedItem.itemId);  // XXX nsINavHistoryResultViewer.itemReplaced  // NHQRN.onVisit()->NHCRN.MergeResults()->NHCRN.ReplaceChildURIAt()->NHRV.ItemReplaced()  // XXX nsINavHistoryResultViewer.invalidateContainer  // nsINavHistoryResultViewer.invalidateAll  // nsINavHistoryResultViewer.sortingChanged  result.sortingMode = options.SORT_BY_TITLE_ASCENDING;  do_check_true(viewer.allInvalidated);  do_check_eq(viewer.sortingMode, options.SORT_BY_TITLE_ASCENDING);  // nsINavHistoryResultViewer.containerClosed  root.containerOpen = false;  do_check_eq(viewer.closedContainer, viewer.openedContainer);  result.viewer = null;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8395/b0f92d8d56746ec5a4fdf623cc332521f7da2878/test_nsINavHistoryViewer.js/clean/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js