Index: base/files/file_path_unittest.cc |
diff --git a/base/files/file_path_unittest.cc b/base/files/file_path_unittest.cc |
index 8b2fcf531c96e6c4bdac6e45307faf16cf5d4287..d22817a1d8e84375cb5c618603c95c7905cc1569 100644 |
--- a/base/files/file_path_unittest.cc |
+++ b/base/files/file_path_unittest.cc |
@@ -1228,4 +1228,24 @@ TEST_F(FilePathTest, AsEndingWithSeparator) { |
} |
} |
+#if defined(OS_ANDROID) |
+TEST_F(FilePathTest, ContentUriTest) { |
+ const struct UnaryBooleanTestData cases[] = { |
+ { FPL("content://foo.bar"), true }, |
+ { FPL("content://foo.bar/"), true }, |
+ { FPL("content://foo/bar"), true }, |
+ { FPL("content://"), true }, |
+ { FPL(".. "), false }, |
Tom Sepez
2013/11/11 18:28:34
nit: how about adding some near misses:
content:fo
qinmin
2013/11/11 20:49:53
Done.
|
+ { FPL("foo.bar"), false }, |
+ }; |
+ |
+ for (size_t i = 0; i < arraysize(cases); ++i) { |
+ FilePath input(cases[i].input); |
+ bool observed = input.IsContentUri(); |
+ EXPECT_EQ(cases[i].expected, observed) << |
+ "i: " << i << ", input: " << input.value(); |
+ } |
+} |
+#endif |
+ |
} // namespace base |