B2G/gecko/toolkit/components/places/tests/unit/test_download_history.js
/**
 * Checks to see that a URI is in the database.
 *
 * @param aURI
 *        The URI to check.
 * @param aExpected
 *        Boolean result expected from the db lookup.
 */
Checks to see that a URI is in the database.
@param aURI
The URI to check.
@param aExpected
Boolean result expected from the db lookup.
Checks to see that a URI is in the database . @param aURI The URI to check . @param aExpected Boolean result expected from the db lookup .
function uri_in_db(aURI, aExpected)
{
  let options = PlacesUtils.history.getNewQueryOptions();
  options.maxResults = 1;
  options.includeHidden = true;
  let query = PlacesUtils.history.getNewQuery();
  query.uri = aURI;
  let root = PlacesUtils.history.executeQuery(query, options).root;
  root.containerOpen = true;
  do_check_eq(root.childCount, aExpected ? 1 : 0);
  root.containerOpen = false;
}
function uri_in_db ( aURI , aExpected ) { let options = PlacesUtils . history . getNewQueryOptions ( ) ; options . maxResults = 1 ; options . includeHidden = true ; let query = PlacesUtils . history . getNewQuery ( ) ; query . uri = aURI ; let root = PlacesUtils . history . executeQuery ( query , options ) . root ; root . containerOpen = true ; do_check_eq ( root . childCount , aExpected ? 1 : 0 ) ; root . containerOpen = false ; }
Checks to see that a URI is in the database.
Checks to see that a URI is in the database .
// Close the container explicitly to free resources up earlier.