| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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")); |
| 150 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("audio/x-mpegurl")); |
| 149 | 151 |
| 150 #if defined(USE_PROPRIETARY_CODECS) | 152 #if defined(USE_PROPRIETARY_CODECS) |
| 151 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp4")); | 153 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp4")); |
| 152 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-m4a")); | 154 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-m4a")); |
| 153 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp4")); | 155 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp4")); |
| 154 EXPECT_TRUE(IsSupportedMediaMimeType("video/x-m4v")); | 156 EXPECT_TRUE(IsSupportedMediaMimeType("video/x-m4v")); |
| 155 | 157 |
| 156 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp3")); | 158 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp3")); |
| 157 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-mp3")); | 159 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-mp3")); |
| 158 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mpeg")); | 160 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mpeg")); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); | 423 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); |
| 422 MimeUtil::PlatformInfo test_states; | 424 MimeUtil::PlatformInfo test_states; |
| 423 | 425 |
| 424 RunCodecSupportTest( | 426 RunCodecSupportTest( |
| 425 states_to_vary, test_states, | 427 states_to_vary, test_states, |
| 426 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { | 428 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { |
| 427 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( | 429 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( |
| 428 MimeUtil::MPEG2_AAC, "application/x-mpegurl", false, info)); | 430 MimeUtil::MPEG2_AAC, "application/x-mpegurl", false, info)); |
| 429 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( | 431 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( |
| 430 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info)); | 432 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info)); |
| 433 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( |
| 434 MimeUtil::MPEG2_AAC, "audio/mpegurl", false, info)); |
| 435 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( |
| 436 MimeUtil::MPEG2_AAC, "audio/x-mpegurl", false, info)); |
| 431 }); | 437 }); |
| 432 } | 438 } |
| 433 | 439 |
| 434 } // namespace internal | 440 } // namespace internal |
| 435 } // namespace media | 441 } // namespace media |
| OLD | NEW |