OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 EXPECT_TRUE(IsSupportedMediaMimeType("audio/flac")); | 127 EXPECT_TRUE(IsSupportedMediaMimeType("audio/flac")); |
128 | 128 |
129 EXPECT_TRUE(IsSupportedMediaMimeType("audio/ogg")); | 129 EXPECT_TRUE(IsSupportedMediaMimeType("audio/ogg")); |
130 EXPECT_TRUE(IsSupportedMediaMimeType("application/ogg")); | 130 EXPECT_TRUE(IsSupportedMediaMimeType("application/ogg")); |
131 #if defined(OS_ANDROID) | 131 #if defined(OS_ANDROID) |
132 EXPECT_FALSE(IsSupportedMediaMimeType("video/ogg")); | 132 EXPECT_FALSE(IsSupportedMediaMimeType("video/ogg")); |
133 #else | 133 #else |
134 EXPECT_TRUE(IsSupportedMediaMimeType("video/ogg")); | 134 EXPECT_TRUE(IsSupportedMediaMimeType("video/ogg")); |
135 #endif // OS_ANDROID | 135 #endif // OS_ANDROID |
136 | 136 |
137 #if defined(OS_ANDROID) && defined(USE_PROPRIETARY_CODECS) | 137 #if defined(OS_ANDROID) && BUILDFLAG(USE_PROPRIETARY_CODECS) |
138 // HLS is supported on Android API level 14 and higher and Chrome supports | 138 // HLS is supported on Android API level 14 and higher and Chrome supports |
139 // API levels 15 and higher, so these are expected to be supported. | 139 // API levels 15 and higher, so these are expected to be supported. |
140 bool kHlsSupported = true; | 140 bool kHlsSupported = true; |
141 #else | 141 #else |
142 bool kHlsSupported = false; | 142 bool kHlsSupported = false; |
143 #endif | 143 #endif |
144 | 144 |
145 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("application/x-mpegurl")); | 145 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("application/x-mpegurl")); |
146 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("Application/X-MPEGURL")); | 146 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("Application/X-MPEGURL")); |
147 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType( | 147 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType( |
148 "application/vnd.apple.mpegurl")); | 148 "application/vnd.apple.mpegurl")); |
149 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("audio/mpegurl")); | 149 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("audio/mpegurl")); |
150 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("audio/x-mpegurl")); | 150 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("audio/x-mpegurl")); |
151 | 151 |
152 #if defined(USE_PROPRIETARY_CODECS) | 152 #if BUILDFLAG(USE_PROPRIETARY_CODECS) |
153 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp4")); | 153 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp4")); |
154 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-m4a")); | 154 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-m4a")); |
155 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp4")); | 155 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp4")); |
156 EXPECT_TRUE(IsSupportedMediaMimeType("video/x-m4v")); | 156 EXPECT_TRUE(IsSupportedMediaMimeType("video/x-m4v")); |
157 | 157 |
158 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp3")); | 158 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp3")); |
159 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-mp3")); | 159 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-mp3")); |
160 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mpeg")); | 160 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mpeg")); |
161 EXPECT_TRUE(IsSupportedMediaMimeType("audio/aac")); | 161 EXPECT_TRUE(IsSupportedMediaMimeType("audio/aac")); |
162 | 162 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info)); | 432 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info)); |
433 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( | 433 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( |
434 MimeUtil::MPEG2_AAC, "audio/mpegurl", false, info)); | 434 MimeUtil::MPEG2_AAC, "audio/mpegurl", false, info)); |
435 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( | 435 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( |
436 MimeUtil::MPEG2_AAC, "audio/x-mpegurl", false, info)); | 436 MimeUtil::MPEG2_AAC, "audio/x-mpegurl", false, info)); |
437 }); | 437 }); |
438 } | 438 } |
439 | 439 |
440 } // namespace internal | 440 } // namespace internal |
441 } // namespace media | 441 } // namespace media |
OLD | NEW |