46 var directoryService =
Cc[
"@mozilla.org/file/directory_service;1"]
47 .getService(
Ci.nsIDirectoryServiceProvider);
53 Cc[
"@songbirdnest.com/Songbird/FileUtils;1"].getService(
Ci.sbIFileUtils);
56 "File utilities component is not available.");
59 var currentDir = fileUtils.currentDir;
60 assertTrue(currentDir,
"Could not get the current working directory.");
63 assertTrue(currentDir.equals(directoryService.getFile(
"CurWorkD", {})),
64 "Current working directory not correct.");
67 var temporaryFileService =
68 Cc[
"@songbirdnest.com/Songbird/TemporaryFileService;1"]
69 .getService(
Ci.sbITemporaryFileService);
71 temporaryFileService.createFile(
Ci.nsIFile.DIRECTORY_TYPE);
74 fileUtils.currentDir = testCurrentDir;
75 assertTrue(testCurrentDir.equals(fileUtils.currentDir),
76 "Could not change working directory.");
77 assertTrue(testCurrentDir.equals(directoryService.getFile(
"CurWorkD", {})),
78 "Current working directory not correct.");
81 fileUtils.currentDir = currentDir;
82 assertTrue(currentDir.equals(fileUtils.currentDir),
83 "Could not change to original working directory.");
84 assertTrue(currentDir.equals(directoryService.getFile(
"CurWorkD", {})),
85 "Current working directory not correct.");
function assertTrue(aTest, aMessage)
function runTest()
Advanced DataRemote unit tests.