B2G/gecko/toolkit/mozapps/downloads/tests/unit/test_DownloadPaths.js
/**
 * Provides a temporary save directory.
 *
 * @returns nsIFile pointing to the new or existing directory.
 */
Provides a temporary save directory.
@returns nsIFile pointing to the new or existing directory.
Provides a temporary save directory . @returns nsIFile pointing to the new or existing directory .
function createTemporarySaveDirectory()
{
  var saveDir = Cc["@mozilla.org/file/directory_service;1"].
                getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
  saveDir.append("testsavedir");
  if (!saveDir.exists()) {
    saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0755);
  }
  return saveDir;
}
function createTemporarySaveDirectory ( ) { var saveDir = Cc [ "@mozilla.org/file/directory_service;1" ] . getService ( Ci . nsIProperties ) . get ( "TmpD" , Ci . nsIFile ) ; saveDir . append ( "testsavedir" ) ; if ( ! saveDir . exists ( ) ) { saveDir . create ( Ci . nsIFile . DIRECTORY_TYPE , 0755 ) ; } return saveDir ; }
Provides a temporary save directory.
Provides a temporary save directory .