B2G/gecko/toolkit/components/places/tests/unit/test_248970.js
/**
 * Function performs a really simple query on our places entries,
 * and makes sure that the number of entries equal num_places_entries.
 */
Function performs a really simple query on our places entries,
and makes sure that the number of entries equal num_places_entries.
Function performs a really simple query on our places entries and makes sure that the number of entries equal num_places_entries .
function check_placesItem_Count(){
  let options = PlacesUtils.history.getNewQueryOptions();
  options.includeHidden = true;
  options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
  let root = PlacesUtils.history.executeQuery(PlacesUtils.history.getNewQuery(),
                                              options).root;
  root.containerOpen = true;
  let cc = root.childCount;
  root.containerOpen = false;
  options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_HISTORY;
  let root = PlacesUtils.history.executeQuery(PlacesUtils.history.getNewQuery(),
                                              options).root;
  root.containerOpen = true;
  cc += root.childCount;
  root.containerOpen = false;
  do_check_eq(cc,num_places_entries);
}
function check_placesItem_Count ( ) { let options = PlacesUtils . history . getNewQueryOptions ( ) ; options . includeHidden = true ; options . queryType = Ci . nsINavHistoryQueryOptions . QUERY_TYPE_BOOKMARKS ; let root = PlacesUtils . history . executeQuery ( PlacesUtils . history . getNewQuery ( ) , options ) . root ; root . containerOpen = true ; let cc = root . childCount ; root . containerOpen = false ; options . queryType = Ci . nsINavHistoryQueryOptions . QUERY_TYPE_HISTORY ; let root = PlacesUtils . history . executeQuery ( PlacesUtils . history . getNewQuery ( ) , options ) . root ; root . containerOpen = true ; cc += root . childCount ; root . containerOpen = false ; do_check_eq ( cc , num_places_entries ) ; }
Function performs a really simple query on our places entries,
 and makes sure that the number of entries equal num_places_entries.
Function performs a really simple query on our places entries and makes sure that the number of entries equal num_places_entries .
// get bookmarks count // get history item count // check the total count