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

Unified Diff: media/base/mime_util_unittest.cc

Issue 1128983002: Cleanup unit tests for HLS mime types on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new-move-media-mime
Patch Set: CR feedback 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/mime_util_unittest.cc
diff --git a/media/base/mime_util_unittest.cc b/media/base/mime_util_unittest.cc
index 29752334383c84363f1d444eedbc458df9fbaf62..40796b7e4e762c3948eaf57dff6fd3e80e7d2d7b 100644
--- a/media/base/mime_util_unittest.cc
+++ b/media/base/mime_util_unittest.cc
@@ -7,20 +7,8 @@
#include "media/base/mime_util.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if defined(OS_ANDROID)
-#include "base/android/build_info.h"
-#endif
-
namespace media {
-TEST(MimeUtilTest, LookupTypes) {
-#if defined(OS_ANDROID)
- EXPECT_TRUE(IsSupportedMediaMimeType("application/vnd.apple.mpegurl"));
- EXPECT_TRUE(IsSupportedMediaMimeType("application/x-mpegurl"));
- EXPECT_TRUE(IsSupportedMediaMimeType("Application/X-MPEGURL"));
-#endif
-}
-
TEST(MimeUtilTest, StrictMediaMimeType) {
EXPECT_TRUE(IsStrictMediaMimeType("video/webm"));
EXPECT_TRUE(IsStrictMediaMimeType("Video/WEBM"));
@@ -53,14 +41,6 @@ TEST(MimeUtilTest, StrictMediaMimeType) {
}
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"));
@@ -71,15 +51,23 @@ TEST(MimeUtilTest, CommonMediaMimeType) {
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(OS_ANDROID)
+ // HLS is supported on Android API level 14 and higher and Chrome supports
+ // API levels 15 and higher, so these are expected to be supported.
+ bool kHlsSupported = true;
+#else
+ bool kHlsSupported = false;
+#endif
+
+ EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("application/x-mpegurl"));
+ EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("Application/X-MPEGURL"));
+ EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType(
+ "application/vnd.apple.mpegurl"));
+
#if defined(USE_PROPRIETARY_CODECS)
EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp4"));
EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-m4a"));
« 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