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

Unified Diff: base/file_path_unittest.cc

Issue 205023: Fixed and reenabled AppendRelativePathTest which was broken on Windows. (Closed)
Patch Set: commented out troublesome testcase Created 11 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_path_unittest.cc
diff --git a/base/file_path_unittest.cc b/base/file_path_unittest.cc
index 6825fb28b0b6ae6d652f2ac67923fe218983def4..0bf9ed7396a462d35af43bad3da6874d0c3d3e63 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("")},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698