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

Unified Diff: base/file_path_unittest.cc

Issue 209070: Fix and reenable AppendRelativePathTest which was broken on Windows.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' 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
===================================================================
--- base/file_path_unittest.cc (revision 26943)
+++ base/file_path_unittest.cc (working copy)
@@ -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("")},
« 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