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

Side by Side Diff: base/file_util_unittest.cc

Issue 432001: Remove the deprecated version of ContentsEqual.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/file_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 data_dir.Append(FILE_PATH_LITERAL("binary_file.bin")); 867 data_dir.Append(FILE_PATH_LITERAL("binary_file.bin"));
868 FilePath binary_file_same = 868 FilePath binary_file_same =
869 data_dir.Append(FILE_PATH_LITERAL("binary_file_same.bin")); 869 data_dir.Append(FILE_PATH_LITERAL("binary_file_same.bin"));
870 FilePath binary_file_diff = 870 FilePath binary_file_diff =
871 data_dir.Append(FILE_PATH_LITERAL("binary_file_diff.bin")); 871 data_dir.Append(FILE_PATH_LITERAL("binary_file_diff.bin"));
872 872
873 EXPECT_TRUE(file_util::ContentsEqual(original_file, original_file)); 873 EXPECT_TRUE(file_util::ContentsEqual(original_file, original_file));
874 EXPECT_TRUE(file_util::ContentsEqual(original_file, same_file)); 874 EXPECT_TRUE(file_util::ContentsEqual(original_file, same_file));
875 EXPECT_FALSE(file_util::ContentsEqual(original_file, same_length_file)); 875 EXPECT_FALSE(file_util::ContentsEqual(original_file, same_length_file));
876 EXPECT_FALSE(file_util::ContentsEqual(original_file, different_file)); 876 EXPECT_FALSE(file_util::ContentsEqual(original_file, different_file));
877 EXPECT_FALSE(file_util::ContentsEqual(L"bogusname", L"bogusname")); 877 EXPECT_FALSE(file_util::ContentsEqual(
878 FilePath(FILE_PATH_LITERAL("bogusname")),
879 FilePath(FILE_PATH_LITERAL("bogusname"))));
878 EXPECT_FALSE(file_util::ContentsEqual(original_file, different_first_file)); 880 EXPECT_FALSE(file_util::ContentsEqual(original_file, different_first_file));
879 EXPECT_FALSE(file_util::ContentsEqual(original_file, different_last_file)); 881 EXPECT_FALSE(file_util::ContentsEqual(original_file, different_last_file));
880 EXPECT_TRUE(file_util::ContentsEqual(empty1_file, empty2_file)); 882 EXPECT_TRUE(file_util::ContentsEqual(empty1_file, empty2_file));
881 EXPECT_FALSE(file_util::ContentsEqual(original_file, shortened_file)); 883 EXPECT_FALSE(file_util::ContentsEqual(original_file, shortened_file));
882 EXPECT_FALSE(file_util::ContentsEqual(shortened_file, original_file)); 884 EXPECT_FALSE(file_util::ContentsEqual(shortened_file, original_file));
883 EXPECT_TRUE(file_util::ContentsEqual(binary_file, binary_file_same)); 885 EXPECT_TRUE(file_util::ContentsEqual(binary_file, binary_file_same));
884 EXPECT_FALSE(file_util::ContentsEqual(binary_file, binary_file_diff)); 886 EXPECT_FALSE(file_util::ContentsEqual(binary_file, binary_file_diff));
885 } 887 }
886 888
887 TEST_F(ReadOnlyFileUtilTest, TextContentsEqual) { 889 TEST_F(ReadOnlyFileUtilTest, TextContentsEqual) {
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 #elif defined(OS_LINUX) 1357 #elif defined(OS_LINUX)
1356 EXPECT_FALSE(file_util::ContainsPath(foo, 1358 EXPECT_FALSE(file_util::ContainsPath(foo,
1357 foo_caps.Append(FILE_PATH_LITERAL("bar.txt")))); 1359 foo_caps.Append(FILE_PATH_LITERAL("bar.txt"))));
1358 #else 1360 #else
1359 // We can't really do this test on osx since the case-sensitivity of the 1361 // We can't really do this test on osx since the case-sensitivity of the
1360 // filesystem is configurable. 1362 // filesystem is configurable.
1361 #endif 1363 #endif
1362 } 1364 }
1363 1365
1364 } // namespace 1366 } // namespace
OLDNEW
« no previous file with comments | « base/file_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698