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

Unified Diff: base/file_util_unittest.cc

Issue 3161018: Get rid of the deprecated file_util::InsertBeforeExtension. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: Created 10 years, 4 months 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/file_util_deprecated.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_unittest.cc
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index 7ee762852e209f1c7c2b8497e37670ab6aca8bff..ec62b3c421dcefcb8c821f2480340e1fe6615b39 100644
--- a/base/file_util_unittest.cc
+++ b/base/file_util_unittest.cc
@@ -239,69 +239,6 @@ TEST_F(FileUtilTest, AppendToPath) {
}
#endif // defined(OS_WIN)
-
-static const struct InsertBeforeExtensionCase {
- const FilePath::CharType* path;
- const FilePath::CharType* suffix;
- const FilePath::CharType* result;
-} kInsertBeforeExtension[] = {
- {FPL(""), FPL(""), FPL("")},
- {FPL(""), FPL("txt"), FPL("txt")},
- {FPL("."), FPL("txt"), FPL("txt.")},
- {FPL("."), FPL(""), FPL(".")},
- {FPL("foo.dll"), FPL("txt"), FPL("footxt.dll")},
- {FPL("foo.dll"), FPL(".txt"), FPL("foo.txt.dll")},
- {FPL("foo"), FPL("txt"), FPL("footxt")},
- {FPL("foo"), FPL(".txt"), FPL("foo.txt")},
- {FPL("foo.baz.dll"), FPL("txt"), FPL("foo.baztxt.dll")},
- {FPL("foo.baz.dll"), FPL(".txt"), FPL("foo.baz.txt.dll")},
- {FPL("foo.dll"), FPL(""), FPL("foo.dll")},
- {FPL("foo.dll"), FPL("."), FPL("foo..dll")},
- {FPL("foo"), FPL(""), FPL("foo")},
- {FPL("foo"), FPL("."), FPL("foo.")},
- {FPL("foo.baz.dll"), FPL(""), FPL("foo.baz.dll")},
- {FPL("foo.baz.dll"), FPL("."), FPL("foo.baz..dll")},
-#if defined(OS_WIN)
- {FPL("\\"), FPL(""), FPL("\\")},
- {FPL("\\"), FPL("txt"), FPL("\\txt")},
- {FPL("\\."), FPL("txt"), FPL("\\txt.")},
- {FPL("\\."), FPL(""), FPL("\\.")},
- {FPL("C:\\bar\\foo.dll"), FPL("txt"), FPL("C:\\bar\\footxt.dll")},
- {FPL("C:\\bar.baz\\foodll"), FPL("txt"), FPL("C:\\bar.baz\\foodlltxt")},
- {FPL("C:\\bar.baz\\foo.dll"), FPL("txt"), FPL("C:\\bar.baz\\footxt.dll")},
- {FPL("C:\\bar.baz\\foo.dll.exe"), FPL("txt"),
- FPL("C:\\bar.baz\\foo.dlltxt.exe")},
- {FPL("C:\\bar.baz\\foo"), FPL(""), FPL("C:\\bar.baz\\foo")},
- {FPL("C:\\bar.baz\\foo.exe"), FPL(""), FPL("C:\\bar.baz\\foo.exe")},
- {FPL("C:\\bar.baz\\foo.dll.exe"), FPL(""), FPL("C:\\bar.baz\\foo.dll.exe")},
- {FPL("C:\\bar\\baz\\foo.exe"), FPL(" (1)"), FPL("C:\\bar\\baz\\foo (1).exe")},
-#elif defined(OS_POSIX)
- {FPL("/"), FPL(""), FPL("/")},
- {FPL("/"), FPL("txt"), FPL("/txt")},
- {FPL("/."), FPL("txt"), FPL("/txt.")},
- {FPL("/."), FPL(""), FPL("/.")},
- {FPL("/bar/foo.dll"), FPL("txt"), FPL("/bar/footxt.dll")},
- {FPL("/bar.baz/foodll"), FPL("txt"), FPL("/bar.baz/foodlltxt")},
- {FPL("/bar.baz/foo.dll"), FPL("txt"), FPL("/bar.baz/footxt.dll")},
- {FPL("/bar.baz/foo.dll.exe"), FPL("txt"), FPL("/bar.baz/foo.dlltxt.exe")},
- {FPL("/bar.baz/foo"), FPL(""), FPL("/bar.baz/foo")},
- {FPL("/bar.baz/foo.exe"), FPL(""), FPL("/bar.baz/foo.exe")},
- {FPL("/bar.baz/foo.dll.exe"), FPL(""), FPL("/bar.baz/foo.dll.exe")},
- {FPL("/bar/baz/foo.exe"), FPL(" (1)"), FPL("/bar/baz/foo (1).exe")},
Evan Martin 2010/08/17 19:13:56 Is it worth porting these tests to FilePath's equi
tfarina 2010/08/17 19:39:45 Yup, we already have them at file_path_unittest.cc
-#endif
-};
-
-#if defined(OS_WIN)
-// This function has been deprecated on non-Windows.
-TEST_F(FileUtilTest, InsertBeforeExtensionTest) {
- for (unsigned int i = 0; i < arraysize(kInsertBeforeExtension); ++i) {
- FilePath path(kInsertBeforeExtension[i].path);
- file_util::InsertBeforeExtension(&path, kInsertBeforeExtension[i].suffix);
- EXPECT_EQ(kInsertBeforeExtension[i].result, path.value());
- }
-}
-#endif
-
static const struct filename_case {
const wchar_t* path;
const wchar_t* filename;
« no previous file with comments | « base/file_util_deprecated.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698