summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-23 20:32:41 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-23 20:32:41 +0000
commit48283f82ca649df36f46b3618ad45f86a6fc412d (patch)
tree0de7b83187dc2fdcf9a32b2bdacbd901df1728ef /base
parentd8d5b28057e44f43826c04bce419af560d34d378 (diff)
downloadchromium_src-48283f82ca649df36f46b3618ad45f86a6fc412d.zip
chromium_src-48283f82ca649df36f46b3618ad45f86a6fc412d.tar.gz
chromium_src-48283f82ca649df36f46b3618ad45f86a6fc412d.tar.bz2
Fix and reenable AppendRelativePathTest which was broken on Windows.
Patch by Fred Akalin <akalin@gmail.com> Review URL: http://codereview.chromium.org/205023 Review URL: http://codereview.chromium.org/209070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26968 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/file_path_unittest.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/base/file_path_unittest.cc b/base/file_path_unittest.cc
index 6825fb2..0bf9ed7 100644
--- a/base/file_path_unittest.cc
+++ b/base/file_path_unittest.cc
@@ -485,9 +485,13 @@ TEST_F(FilePathTest, IsParentTest) {
}
}
-TEST_F(FilePathTest, DISABLED_AppendRelativePathTest) {
+TEST_F(FilePathTest, AppendRelativePathTest) {
const struct BinaryTestData cases[] = {
+#if defined(FILE_PATH_USES_WIN_SEPARATORS)
+ { { FPL("/"), FPL("/foo/bar/baz") }, FPL("foo\\bar\\baz")},
+#else // FILE_PATH_USES_WIN_SEPARATORS
{ { FPL("/"), FPL("/foo/bar/baz") }, FPL("foo/bar/baz")},
+#endif // FILE_PATH_USES_WIN_SEPARATORS
{ { FPL("/foo/bar"), FPL("/foo/bar/baz") }, FPL("baz")},
{ { FPL("/foo/bar/"), FPL("/foo/bar/baz") }, FPL("baz")},
{ { FPL("//foo/bar/"), FPL("//foo/bar/baz") }, FPL("baz")},
@@ -506,8 +510,14 @@ TEST_F(FilePathTest, DISABLED_AppendRelativePathTest) {
{ { FPL("f:/foo/bar"), FPL("F:/foo/bar/baz") }, FPL("baz")},
{ { FPL("E:/Foo/bar"), FPL("e:/foo/bar/baz") }, FPL("")},
{ { FPL("f:/foo/bar"), FPL("F:/foo/Bar/baz") }, FPL("")},
- { { FPL("c:/"), FPL("c:/foo/bar/baz") }, FPL("foo/bar/baz")},
- { { FPL("c:"), FPL("c:/foo/bar/baz") }, FPL("foo/bar/baz")},
+#if defined(FILE_PATH_USES_WIN_SEPARATORS)
+ { { FPL("c:/"), FPL("c:/foo/bar/baz") }, FPL("foo\\bar\\baz")},
+ // TODO(akalin): Figure out how to handle the corner case in the
+ // commented-out test case below. Appending to an empty path gives
+ // /foo\bar\baz but appending to a nonempty path "blah" gives
+ // blah\foo\bar\baz.
+ // { { FPL("c:"), FPL("c:/foo/bar/baz") }, FPL("foo\\bar\\baz")},
+#endif // FILE_PATH_USES_WIN_SEPARATORS
{ { FPL("c:/foo/bar"), FPL("d:/foo/bar/baz") }, FPL("")},
{ { FPL("c:/foo/bar"), FPL("D:/foo/bar/baz") }, FPL("")},
{ { FPL("C:/foo/bar"), FPL("d:/foo/bar/baz") }, FPL("")},