Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3376)

Unified Diff: base/files/file_util_unittest.cc

Issue 603683005: base::CopyFile can copy *from* Android's content scheme. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: base::internal::CopyFileUnsafe -> base::CopyFile Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/files/file_util_posix.cc ('k') | base/files/file_util_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_util_unittest.cc
diff --git a/base/files/file_util_unittest.cc b/base/files/file_util_unittest.cc
index 08c9587cc0655895e4604cc7e85be88f25215d05..29d51330dcdcd7378e1a8487c4c2dcafc7a57a7d 100644
--- a/base/files/file_util_unittest.cc
+++ b/base/files/file_util_unittest.cc
@@ -1471,30 +1471,29 @@ TEST_F(FileUtilTest, CopyFile) {
FilePath dest_file = dir_name_from.Append(FILE_PATH_LITERAL("DestFile.txt"));
ASSERT_TRUE(CopyFile(file_name_from, dest_file));
- // Copy the file to another location using '..' in the path.
+ // Try to copy the file to another location using '..' in the path.
FilePath dest_file2(dir_name_from);
dest_file2 = dest_file2.AppendASCII("..");
dest_file2 = dest_file2.AppendASCII("DestFile.txt");
ASSERT_FALSE(CopyFile(file_name_from, dest_file2));
- ASSERT_TRUE(internal::CopyFileUnsafe(file_name_from, dest_file2));
FilePath dest_file2_test(dir_name_from);
dest_file2_test = dest_file2_test.DirName();
dest_file2_test = dest_file2_test.AppendASCII("DestFile.txt");
- // Check everything has been copied.
+ // Check expected copy results.
EXPECT_TRUE(PathExists(file_name_from));
EXPECT_TRUE(PathExists(dest_file));
const std::wstring read_contents = ReadTextFile(dest_file);
EXPECT_EQ(file_contents, read_contents);
- EXPECT_TRUE(PathExists(dest_file2_test));
- EXPECT_TRUE(PathExists(dest_file2));
+ EXPECT_FALSE(PathExists(dest_file2_test));
+ EXPECT_FALSE(PathExists(dest_file2));
}
TEST_F(FileUtilTest, CopyFileACL) {
// While FileUtilTest.CopyFile asserts the content is correctly copied over,
// this test case asserts the access control bits are meeting expectations in
- // CopyFileUnsafe().
+ // CopyFile().
FilePath src = temp_dir_.path().Append(FILE_PATH_LITERAL("src.txt"));
const std::wstring file_contents(L"Gooooooooooooooooooooogle");
CreateTextFile(src, file_contents);
« no previous file with comments | « base/files/file_util_posix.cc ('k') | base/files/file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698