B2G/gecko/toolkit/components/downloads/test/unit/head_download_manager.js
/**
 * Imports a download test file to use.  Works with rdf and sqlite files.
 *
 * @param aFName
 *        The name of the file to import.  This file should be located in the
 *        same directory as this file.
 */
Imports a download test file to use.  Works with rdf and sqlite files.
@param aFName
The name of the file to import.  This file should be located in the
same directory as this file.
Imports a download test file to use . Works with rdf and sqlite files . @param aFName The name of the file to import . This file should be located in the same directory as this file .
function importDownloadsFile(aFName)
{
  var file = do_get_file(aFName);
  var newFile = dirSvc.get("ProfD", Ci.nsIFile);
  if (/\.rdf$/i.test(aFName))
    file.copyTo(newFile, "downloads.rdf");
  else if (/\.sqlite$/i.test(aFName))
    file.copyTo(newFile, "downloads.sqlite");
  else
    do_throw("Unexpected filename!");
}
function importDownloadsFile ( aFName ) { var file = do_get_file ( aFName ) ; var newFile = dirSvc . get ( "ProfD" , Ci . nsIFile ) ; if ( / \.rdf$ / i . test ( aFName ) ) file . copyTo ( newFile , "downloads.rdf" ) ; else if ( / \.sqlite$ / i . test ( aFName ) ) file . copyTo ( newFile , "downloads.sqlite" ) ; else do_throw ( "Unexpected filename!" ) ; }
Imports a download test file to use.
Imports a download test file to use .