B2G/gecko/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
/**
 * Adds a download to download history.
 *
 * @param aURIString
 *        The string of the URI to add.
 * @param aIsActive
 *        If it should be set to an active state in the database.  This does not
 *        make it show up in the list of active downloads however!
 */
Adds a download to download history.
@param aURIString
The string of the URI to add.
@param aIsActive
If it should be set to an active state in the database.  This does not
make it show up in the list of active downloads however!
Adds a download to download history . @param aURIString The string of the URI to add . @param aIsActive If it should be set to an active state in the database . This does not make it show up in the list of active downloads however!
function add_download(aURIString, aIsActive)
{
  check_downloaded(aURIString, false);
  let db = Cc["@mozilla.org/download-manager;1"].
           getService(Ci.nsIDownloadManager).
           DBConnection;
  let stmt = db.createStatement(
    "INSERT INTO moz_downloads (source, state) " +
    "VALUES (:source, :state)"
  );
  stmt.params.source = aURIString;
  stmt.params.state = aIsActive ? Ci.nsIDownloadManager.DOWNLOAD_DOWNLOADING :
                                  Ci.nsIDownloadManager.DOWNLOAD_FINISHED;
  try {
    stmt.execute();
  }
  finally {
    stmt.finalize();
  }
  check_downloaded(aURIString, true);
}
function add_download ( aURIString , aIsActive ) { check_downloaded ( aURIString , false ) ; let db = Cc [ "@mozilla.org/download-manager;1" ] . getService ( Ci . nsIDownloadManager ) . DBConnection ; let stmt = db . createStatement ( "INSERT INTO moz_downloads (source, state) " + "VALUES (:source, :state)" ) ; stmt . params . source = aURIString ; stmt . params . state = aIsActive ? Ci . nsIDownloadManager . DOWNLOAD_DOWNLOADING : Ci . nsIDownloadManager . DOWNLOAD_FINISHED ; try { stmt . execute ( ) ; } finally { stmt . finalize ( ) ; } check_downloaded ( aURIString , true ) ; }
Adds a download to download history.
Adds a download to download history .