diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/base/mime_util.cc | 9 | ||||
-rw-r--r-- | net/base/mime_util_unittest.cc | 5 |
2 files changed, 6 insertions, 8 deletions
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc index 03d09ad..e3ef145 100644 --- a/net/base/mime_util.cc +++ b/net/base/mime_util.cc @@ -242,9 +242,12 @@ bool MimeUtil::IsViewSourceMimeType(const char* mime_type) const { // Mirrors WebViewImpl::CanShowMIMEType() bool MimeUtil::IsSupportedMimeType(const std::string& mime_type) const { - return (mime_type.compare(0, 6, "image/") == 0 && - IsSupportedImageMimeType(mime_type.c_str())) || - IsSupportedNonImageMimeType(mime_type.c_str()); + if (mime_type.compare(0, 5, "text/") == 0 || + (mime_type.compare(0, 6, "image/") == 0 && + IsSupportedImageMimeType(mime_type.c_str())) || + IsSupportedNonImageMimeType(mime_type.c_str())) + return true; + return false; } bool MimeUtil::MatchesMimeType(const std::string &mime_type_pattern, diff --git a/net/base/mime_util_unittest.cc b/net/base/mime_util_unittest.cc index a49dfe3..d966005 100644 --- a/net/base/mime_util_unittest.cc +++ b/net/base/mime_util_unittest.cc @@ -65,11 +65,6 @@ TEST(MimeUtilTest, LookupTypes) { EXPECT_EQ(false, net::IsSupportedImageMimeType("image/lolcat")); EXPECT_EQ(true, net::IsSupportedNonImageMimeType("text/html")); EXPECT_EQ(false, net::IsSupportedNonImageMimeType("text/virus")); - - EXPECT_EQ(true, net::IsSupportedMimeType("image/jpeg")); - EXPECT_EQ(false, net::IsSupportedMimeType("image/lolcat")); - EXPECT_EQ(true, net::IsSupportedMimeType("text/html")); - EXPECT_EQ(false, net::IsSupportedMimeType("text/virus")); } TEST(MimeUtilTest, MatchesMimeType) { |