summaryrefslogtreecommitdiffstats
path: root/base/file_util_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/file_util_unittest.cc')
-rw-r--r--base/file_util_unittest.cc63
1 files changed, 0 insertions, 63 deletions
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
index 7ee7628..ec62b3c 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")},
-#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;