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

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: Modified CopyFile test to assert inability to copy to parent dir. 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') | no next file » | 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..46375ccdeb5053956364ca85826044f521fea096 100644
--- a/base/files/file_util_unittest.cc
+++ b/base/files/file_util_unittest.cc
@@ -1471,12 +1471,12 @@ 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));
+ ASSERT_FALSE(internal::CopyFileUnsafe(file_name_from, dest_file2));
rvargas (doing something else) 2014/11/11 23:40:49 Aha!. So the code was already there :) What we ne
FilePath dest_file2_test(dir_name_from);
dest_file2_test = dest_file2_test.DirName();
@@ -1487,8 +1487,8 @@ TEST_F(FileUtilTest, CopyFile) {
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) {
« no previous file with comments | « base/files/file_util_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698