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

Unified Diff: net/base/mime_util_unittest.cc

Issue 1134393002: Implement ChromeOS mime type extension mappings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 7 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 | « net/base/mime_util.cc ('k') | net/base/platform_mime_util_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/mime_util_unittest.cc
diff --git a/net/base/mime_util_unittest.cc b/net/base/mime_util_unittest.cc
index dca622f6e955d1ccfc522be5ccfd8fa90cee7ca7..f23426d62f95989ff470af5dfc76114fb128dc52 100644
--- a/net/base/mime_util_unittest.cc
+++ b/net/base/mime_util_unittest.cc
@@ -15,8 +15,14 @@
namespace net {
TEST(MimeUtilTest, ExtensionTest) {
+ // String: png\0css
+ base::FilePath::StringType containsNullByte;
+ containsNullByte.append(FILE_PATH_LITERAL("png"));
+ containsNullByte.append(1, FILE_PATH_LITERAL('\0'));
+ containsNullByte.append(FILE_PATH_LITERAL("css"));
+
const struct {
- const base::FilePath::CharType* extension;
+ const base::FilePath::StringType extension;
const char* const mime_type;
bool valid;
} tests[] = {
@@ -25,10 +31,16 @@ TEST(MimeUtilTest, ExtensionTest) {
{FILE_PATH_LITERAL("css"), "text/css", true},
{FILE_PATH_LITERAL("pjp"), "image/jpeg", true},
{FILE_PATH_LITERAL("pjpeg"), "image/jpeg", true},
+#if defined(OS_CHROMEOS)
+ // These two are test cases for testing platform mime types on Chrome OS.
+ {FILE_PATH_LITERAL("epub"), "application/epub+zip", true},
+ {FILE_PATH_LITERAL("ics"), "text/calendar", true},
+#endif
#if defined(OS_ANDROID)
{FILE_PATH_LITERAL("m3u8"), "application/x-mpegurl", true},
#endif
{FILE_PATH_LITERAL("not an extension / for sure"), "", false},
+ {containsNullByte, "", false}
};
std::string mime_type;
« no previous file with comments | « net/base/mime_util.cc ('k') | net/base/platform_mime_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698