B2G/gecko/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
/**
 * Checks to ensure a URI string is in download history or not.
 *
 * @param aURIString
 *        The string of the URI to check.
 * @param aIsDownloaded
 *        True if the URI should be downloaded, false otherwise.
 */
Checks to ensure a URI string is in download history or not.
@param aURIString
The string of the URI to check.
@param aIsDownloaded
True if the URI should be downloaded, false otherwise.
Checks to ensure a URI string is in download history or not . @param aURIString The string of the URI to check . @param aIsDownloaded True if the URI should be downloaded false otherwise .
function check_downloaded(aURIString, aIsDownloaded)
{
  let db = Cc["@mozilla.org/download-manager;1"].
           getService(Ci.nsIDownloadManager).
           DBConnection;
  let stmt = db.createStatement(
    "SELECT * " +
    "FROM moz_downloads " +
    "WHERE source = :source"
  );
  stmt.params.source = aURIString;
  let checker = aIsDownloaded ? do_check_true : do_check_false;
  try {
    checker(stmt.executeStep());
  }
  finally {
    stmt.finalize();
  }
}
function check_downloaded ( aURIString , aIsDownloaded ) { let db = Cc [ "@mozilla.org/download-manager;1" ] . getService ( Ci . nsIDownloadManager ) . DBConnection ; let stmt = db . createStatement ( "SELECT * " + "FROM moz_downloads " + "WHERE source = :source" ) ; stmt . params . source = aURIString ; let checker = aIsDownloaded ? do_check_true : do_check_false ; try { checker ( stmt . executeStep ( ) ) ; } finally { stmt . finalize ( ) ; } }
Checks to ensure a URI string is in download history or not.
Checks to ensure a URI string is in download history or not .