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


CrOS-Libchrome-Original-Commit: 48283f82ca649df36f46b3618ad45f86a6fc412d
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, 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 @@
     { { 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("")},