Index: net/base/mime_util_unittest.cc |
diff --git a/net/base/mime_util_unittest.cc b/net/base/mime_util_unittest.cc |
index 1b29aff6b310c2c441396402bb14a71fcbe1d138..e8a519157d4d78887f281448e04c90abb9162ab0 100644 |
--- a/net/base/mime_util_unittest.cc |
+++ b/net/base/mime_util_unittest.cc |
@@ -93,9 +93,6 @@ TEST(MimeUtilTest, LookupTypes) { |
#if defined(OS_ANDROID) |
EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-x509-ca-cert")); |
EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-pkcs12")); |
- EXPECT_TRUE(IsSupportedMediaMimeType("application/vnd.apple.mpegurl")); |
- EXPECT_TRUE(IsSupportedMediaMimeType("application/x-mpegurl")); |
- EXPECT_TRUE(IsSupportedMediaMimeType("Application/X-MPEGURL")); |
#endif |
EXPECT_TRUE(IsSupportedMimeType("image/jpeg")); |
@@ -112,37 +109,6 @@ TEST(MimeUtilTest, LookupTypes) { |
EXPECT_FALSE(IsSupportedNonImageMimeType("Application/VND.DOC;X=Y+JSON")); |
} |
-TEST(MimeUtilTest, StrictMediaMimeType) { |
- EXPECT_TRUE(IsStrictMediaMimeType("video/webm")); |
- EXPECT_TRUE(IsStrictMediaMimeType("Video/WEBM")); |
- EXPECT_TRUE(IsStrictMediaMimeType("audio/webm")); |
- |
- EXPECT_TRUE(IsStrictMediaMimeType("audio/wav")); |
- EXPECT_TRUE(IsStrictMediaMimeType("audio/x-wav")); |
- |
- EXPECT_TRUE(IsStrictMediaMimeType("video/ogg")); |
- EXPECT_TRUE(IsStrictMediaMimeType("audio/ogg")); |
- EXPECT_TRUE(IsStrictMediaMimeType("application/ogg")); |
- |
- EXPECT_TRUE(IsStrictMediaMimeType("audio/mpeg")); |
- EXPECT_TRUE(IsStrictMediaMimeType("audio/mp3")); |
- EXPECT_TRUE(IsStrictMediaMimeType("audio/x-mp3")); |
- |
- EXPECT_TRUE(IsStrictMediaMimeType("video/mp4")); |
- EXPECT_TRUE(IsStrictMediaMimeType("video/x-m4v")); |
- EXPECT_TRUE(IsStrictMediaMimeType("audio/mp4")); |
- EXPECT_TRUE(IsStrictMediaMimeType("audio/x-m4a")); |
- |
- EXPECT_TRUE(IsStrictMediaMimeType("application/x-mpegurl")); |
- EXPECT_TRUE(IsStrictMediaMimeType("application/vnd.apple.mpegurl")); |
- |
- EXPECT_FALSE(IsStrictMediaMimeType("video/unknown")); |
- EXPECT_FALSE(IsStrictMediaMimeType("Video/UNKNOWN")); |
- EXPECT_FALSE(IsStrictMediaMimeType("audio/unknown")); |
- EXPECT_FALSE(IsStrictMediaMimeType("application/unknown")); |
- EXPECT_FALSE(IsStrictMediaMimeType("unknown/unknown")); |
-} |
- |
TEST(MimeUtilTest, MatchesMimeType) { |
// MIME types are case insensitive. |
EXPECT_TRUE(MatchesMimeType("VIDEO/*", "video/x-mpeg")); |
@@ -222,104 +188,6 @@ TEST(MimeUtilTest, MatchesMimeType) { |
EXPECT_TRUE(MatchesMimeType("ab/*cd", "ab/xxxcd")); |
} |
-TEST(MimeUtilTest, CommonMediaMimeType) { |
-#if defined(OS_ANDROID) |
- bool HLSSupported; |
- if (base::android::BuildInfo::GetInstance()->sdk_int() < 14) |
- HLSSupported = false; |
- else |
- HLSSupported = true; |
-#endif |
- |
- EXPECT_TRUE(IsSupportedMediaMimeType("audio/webm")); |
- EXPECT_TRUE(IsSupportedMediaMimeType("video/webm")); |
- |
- EXPECT_TRUE(IsSupportedMediaMimeType("audio/wav")); |
- EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-wav")); |
- |
- EXPECT_TRUE(IsSupportedMediaMimeType("audio/ogg")); |
- EXPECT_TRUE(IsSupportedMediaMimeType("application/ogg")); |
-#if defined(OS_ANDROID) |
- EXPECT_FALSE(IsSupportedMediaMimeType("video/ogg")); |
- EXPECT_EQ(HLSSupported, IsSupportedMediaMimeType("application/x-mpegurl")); |
- EXPECT_EQ(HLSSupported, |
- IsSupportedMediaMimeType("application/vnd.apple.mpegurl")); |
-#else |
- EXPECT_TRUE(IsSupportedMediaMimeType("video/ogg")); |
- EXPECT_FALSE(IsSupportedMediaMimeType("application/x-mpegurl")); |
- EXPECT_FALSE(IsSupportedMediaMimeType("application/vnd.apple.mpegurl")); |
-#endif // OS_ANDROID |
- |
-#if defined(USE_PROPRIETARY_CODECS) |
- EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp4")); |
- EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-m4a")); |
- EXPECT_TRUE(IsSupportedMediaMimeType("video/mp4")); |
- EXPECT_TRUE(IsSupportedMediaMimeType("video/x-m4v")); |
- |
- EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp3")); |
- EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-mp3")); |
- EXPECT_TRUE(IsSupportedMediaMimeType("audio/mpeg")); |
- EXPECT_TRUE(IsSupportedMediaMimeType("audio/aac")); |
- |
-#if defined(ENABLE_MPEG2TS_STREAM_PARSER) |
- EXPECT_TRUE(IsSupportedMediaMimeType("video/mp2t")); |
-#else |
- EXPECT_FALSE(IsSupportedMediaMimeType("video/mp2t")); |
-#endif |
-#else |
- EXPECT_FALSE(IsSupportedMediaMimeType("audio/mp4")); |
- EXPECT_FALSE(IsSupportedMediaMimeType("audio/x-m4a")); |
- EXPECT_FALSE(IsSupportedMediaMimeType("video/mp4")); |
- EXPECT_FALSE(IsSupportedMediaMimeType("video/x-m4v")); |
- |
- EXPECT_FALSE(IsSupportedMediaMimeType("audio/mp3")); |
- EXPECT_FALSE(IsSupportedMediaMimeType("audio/x-mp3")); |
- EXPECT_FALSE(IsSupportedMediaMimeType("audio/mpeg")); |
- EXPECT_FALSE(IsSupportedMediaMimeType("audio/aac")); |
-#endif // USE_PROPRIETARY_CODECS |
- EXPECT_FALSE(IsSupportedMediaMimeType("video/mp3")); |
- |
- EXPECT_FALSE(IsSupportedMediaMimeType("video/unknown")); |
- EXPECT_FALSE(IsSupportedMediaMimeType("audio/unknown")); |
- EXPECT_FALSE(IsSupportedMediaMimeType("unknown/unknown")); |
-} |
- |
-// Note: codecs should only be a list of 2 or fewer; hence the restriction of |
-// results' length to 2. |
-TEST(MimeUtilTest, ParseCodecString) { |
- const struct { |
- const char* const original; |
- size_t expected_size; |
- const char* const results[2]; |
- } tests[] = { |
- { "\"bogus\"", 1, { "bogus" } }, |
- { "0", 1, { "0" } }, |
- { "avc1.42E01E, mp4a.40.2", 2, { "avc1", "mp4a" } }, |
- { "\"mp4v.20.240, mp4a.40.2\"", 2, { "mp4v", "mp4a" } }, |
- { "mp4v.20.8, samr", 2, { "mp4v", "samr" } }, |
- { "\"theora, vorbis\"", 2, { "theora", "vorbis" } }, |
- { "", 0, { } }, |
- { "\"\"", 0, { } }, |
- { "\" \"", 0, { } }, |
- { ",", 2, { "", "" } }, |
- }; |
- |
- for (size_t i = 0; i < arraysize(tests); ++i) { |
- std::vector<std::string> codecs_out; |
- ParseCodecString(tests[i].original, &codecs_out, true); |
- ASSERT_EQ(tests[i].expected_size, codecs_out.size()); |
- for (size_t j = 0; j < tests[i].expected_size; ++j) |
- EXPECT_EQ(tests[i].results[j], codecs_out[j]); |
- } |
- |
- // Test without stripping the codec type. |
- std::vector<std::string> codecs_out; |
- ParseCodecString("avc1.42E01E, mp4a.40.2", &codecs_out, false); |
- ASSERT_EQ(2u, codecs_out.size()); |
- EXPECT_EQ("avc1.42E01E", codecs_out[0]); |
- EXPECT_EQ("mp4a.40.2", codecs_out[1]); |
-} |
- |
TEST(MimeUtilTest, TestParseMimeTypeWithoutParameter) { |
std::string nonAscii("application/nonutf8"); |
EXPECT_TRUE(ParseMimeTypeWithoutParameter(nonAscii, NULL, NULL)); |