Skip to content

Commit

Permalink
Bug 482942. Tests for nsILocalFile implementations. Also changes nsLo…
Browse files Browse the repository at this point in the history
…calFileUnix::MoveTo to update the object to refer to the destination, matching other platforms' behaviour. r=bsmedberg
  • Loading branch information
rocallahan committed Mar 24, 2009
1 parent 5373165 commit b36cee1
Show file tree
Hide file tree
Showing 6 changed files with 570 additions and 469 deletions.
1 change: 1 addition & 0 deletions xpcom/io/nsIFile.idl
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ interface nsIFile : nsISupports
* (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST).
* If 'this' is a file, and the destination file already exists, moveTo
* will replace the old file.
* This object is updated to refer to the new file.
*
* moveTo will NOT resolve aliases/shortcuts during the copy.
* moveTo will do the right thing and allow copies across volumes.
Expand Down
5 changes: 5 additions & 0 deletions xpcom/io/nsLocalFileUnix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,11 @@ nsLocalFile::MoveToNative(nsIFile *newParent, const nsACString &newName)
rv = NSRESULT_FOR_ERRNO();
}
}

if (NS_SUCCEEDED(rv)) {
// Adjust this
mPath = newPathName;
}
return rv;
}

Expand Down
2 changes: 1 addition & 1 deletion xpcom/tests/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ REQUIRES = \

CPPSRCS = \
nsIFileEnumerator.cpp \
nsIFileTest.cpp \
TestCallTemplates.cpp \
TestINIParser.cpp \
TestRacingServiceManager.cpp \
Expand All @@ -90,6 +89,7 @@ CPP_UNIT_TESTS = \
TestCOMPtr.cpp \
TestCOMPtrEq.cpp \
TestFactory.cpp \
TestFile.cpp \
TestHashtables.cpp \
TestID.cpp \
TestObserverService.cpp \
Expand Down
Loading

0 comments on commit b36cee1

Please sign in to comment.