B2G/gecko/toolkit/components/places/tests/unit/test_454977.js
/**
 * Checks for results consistency, using visit_count as constraint
 * @param   aExpectedCount
 *          Number of history results we are expecting (excluded hidden ones)
 * @param   aExpectedCountWithHidden
 *          Number of history results we are expecting (included hidden ones)
 */
Checks for results consistency, using visit_count as constraint
@param   aExpectedCount
Number of history results we are expecting (excluded hidden ones)
@param   aExpectedCountWithHidden
Number of history results we are expecting (included hidden ones)
Checks for results consistency using visit_count as constraint @param aExpectedCount Number of history results we are expecting ( excluded hidden ones ) @param aExpectedCountWithHidden Number of history results we are expecting ( included hidden ones )
function check_results(aExpectedCount, aExpectedCountWithHidden) {
  let query = PlacesUtils.history.getNewQuery();
  query.minVisits = visit_count;
  query.maxVisits = visit_count;
  let options = PlacesUtils.history.getNewQueryOptions();
  options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_HISTORY;
  let root = PlacesUtils.history.executeQuery(query, options).root;
  root.containerOpen = true;
  do_check_eq(root.childCount, aExpectedCount);
  root.containerOpen = false;
  options.includeHidden = true;
  root = PlacesUtils.history.executeQuery(query, options).root;
  root.containerOpen = true;
  do_check_eq(root.childCount, aExpectedCountWithHidden);
  root.containerOpen = false;
}
function check_results ( aExpectedCount , aExpectedCountWithHidden ) { let query = PlacesUtils . history . getNewQuery ( ) ; query . minVisits = visit_count ; query . maxVisits = visit_count ; let options = PlacesUtils . history . getNewQueryOptions ( ) ; options . queryType = Ci . nsINavHistoryQueryOptions . QUERY_TYPE_HISTORY ; let root = PlacesUtils . history . executeQuery ( query , options ) . root ; root . containerOpen = true ; do_check_eq ( root . childCount , aExpectedCount ) ; root . containerOpen = false ; options . includeHidden = true ; root = PlacesUtils . history . executeQuery ( query , options ) . root ; root . containerOpen = true ; do_check_eq ( root . childCount , aExpectedCountWithHidden ) ; root . containerOpen = false ; }
Checks for results consistency, using visit_count as constraint
 @param   aExpectedCount
          Number of history results we are expecting (excluded hidden ones)
 @param   aExpectedCountWithHidden
          Number of history results we are expecting (included hidden ones)
Checks for results consistency using visit_count as constraint @param aExpectedCount Number of history results we are expecting ( excluded hidden ones ) @param aExpectedCountWithHidden Number of history results we are expecting ( included hidden ones )
// used to check visit_count // Children without hidden ones // Execute again with includeHidden = true // This will ensure visit_count is correct // Children with hidden ones