| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 break; | 275 break; |
| 276 | 276 |
| 277 case MimeUtil::VP8: | 277 case MimeUtil::VP8: |
| 278 EXPECT_EQ(info.has_platform_vp8_decoder, result); | 278 EXPECT_EQ(info.has_platform_vp8_decoder, result); |
| 279 break; | 279 break; |
| 280 | 280 |
| 281 case MimeUtil::VP9: | 281 case MimeUtil::VP9: |
| 282 EXPECT_EQ(info.has_platform_vp9_decoder, result); | 282 EXPECT_EQ(info.has_platform_vp9_decoder, result); |
| 283 break; | 283 break; |
| 284 | 284 |
| 285 case MimeUtil::HEVC_MAIN: | 285 case MimeUtil::HEVC: |
| 286 EXPECT_EQ(HasHevcSupport(), result); | 286 EXPECT_EQ(HasHevcSupport(), result); |
| 287 break; | 287 break; |
| 288 } | 288 } |
| 289 }); | 289 }); |
| 290 } | 290 } |
| 291 | 291 |
| 292 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithAndroidPipeline) { | 292 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithAndroidPipeline) { |
| 293 // Vary all parameters except |is_unified_media_pipeline_enabled|. | 293 // Vary all parameters except |is_unified_media_pipeline_enabled|. |
| 294 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); | 294 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); |
| 295 states_to_vary.is_unified_media_pipeline_enabled = false; | 295 states_to_vary.is_unified_media_pipeline_enabled = false; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 326 // The remaining codecs depend on the platform version. | 326 // The remaining codecs depend on the platform version. |
| 327 case MimeUtil::OPUS: | 327 case MimeUtil::OPUS: |
| 328 EXPECT_EQ(info.supports_opus, result); | 328 EXPECT_EQ(info.supports_opus, result); |
| 329 break; | 329 break; |
| 330 | 330 |
| 331 case MimeUtil::VP9: | 331 case MimeUtil::VP9: |
| 332 // MediaPlayer only supports VP9 in WebM. | 332 // MediaPlayer only supports VP9 in WebM. |
| 333 EXPECT_FALSE(result); | 333 EXPECT_FALSE(result); |
| 334 break; | 334 break; |
| 335 | 335 |
| 336 case MimeUtil::HEVC_MAIN: | 336 case MimeUtil::HEVC: |
| 337 EXPECT_EQ(HasHevcSupport(), result); | 337 EXPECT_EQ(HasHevcSupport(), result); |
| 338 break; | 338 break; |
| 339 } | 339 } |
| 340 }); | 340 }); |
| 341 | 341 |
| 342 // Verify vp9 support in WebM. | 342 // Verify vp9 support in WebM. |
| 343 RunCodecSupportTest( | 343 RunCodecSupportTest( |
| 344 states_to_vary, test_states, | 344 states_to_vary, test_states, |
| 345 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { | 345 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { |
| 346 const bool result = MimeUtil::IsCodecSupportedOnPlatform( | 346 const bool result = MimeUtil::IsCodecSupportedOnPlatform( |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 case MimeUtil::VP8: | 383 case MimeUtil::VP8: |
| 384 case MimeUtil::VP9: | 384 case MimeUtil::VP9: |
| 385 EXPECT_TRUE(result); | 385 EXPECT_TRUE(result); |
| 386 break; | 386 break; |
| 387 | 387 |
| 388 // These codecs are only supported if platform decoders are supported. | 388 // These codecs are only supported if platform decoders are supported. |
| 389 case MimeUtil::H264: | 389 case MimeUtil::H264: |
| 390 EXPECT_EQ(info.has_platform_decoders, result); | 390 EXPECT_EQ(info.has_platform_decoders, result); |
| 391 break; | 391 break; |
| 392 | 392 |
| 393 case MimeUtil::HEVC_MAIN: | 393 case MimeUtil::HEVC: |
| 394 EXPECT_EQ(HasHevcSupport() && info.has_platform_decoders, result); | 394 EXPECT_EQ(HasHevcSupport() && info.has_platform_decoders, result); |
| 395 break; | 395 break; |
| 396 } | 396 } |
| 397 }); | 397 }); |
| 398 } | 398 } |
| 399 | 399 |
| 400 TEST(IsCodecSupportedOnPlatformTest, OpusOggSupport) { | 400 TEST(IsCodecSupportedOnPlatformTest, OpusOggSupport) { |
| 401 // Vary all parameters; thus use default initial state. | 401 // Vary all parameters; thus use default initial state. |
| 402 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); | 402 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); |
| 403 MimeUtil::PlatformInfo test_states; | 403 MimeUtil::PlatformInfo test_states; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 421 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { | 421 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { |
| 422 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( | 422 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( |
| 423 MimeUtil::MPEG2_AAC, "application/x-mpegurl", false, info)); | 423 MimeUtil::MPEG2_AAC, "application/x-mpegurl", false, info)); |
| 424 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( | 424 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( |
| 425 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info)); | 425 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info)); |
| 426 }); | 426 }); |
| 427 } | 427 } |
| 428 | 428 |
| 429 } // namespace internal | 429 } // namespace internal |
| 430 } // namespace media | 430 } // namespace media |
| OLD | NEW |