Chromium Code Reviews| 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 // a platform decoder is available. | 275 // a platform decoder is available. |
| 276 case MimeUtil::OPUS: | 276 case MimeUtil::OPUS: |
| 277 EXPECT_EQ(info.supports_opus, result); | 277 EXPECT_EQ(info.supports_opus, result); |
| 278 break; | 278 break; |
| 279 | 279 |
| 280 case MimeUtil::VP8: | 280 case MimeUtil::VP8: |
| 281 EXPECT_EQ(info.has_platform_vp8_decoder, result); | 281 EXPECT_EQ(info.has_platform_vp8_decoder, result); |
| 282 break; | 282 break; |
| 283 | 283 |
| 284 case MimeUtil::VP9: | 284 case MimeUtil::VP9: |
| 285 EXPECT_EQ(info.supports_vp9, result); | 285 // VP9 is only supported with WebM. |
|
ddorwin
2016/03/10 18:16:54
// *Encrypted* VP9...
We should probably have a T
kqyang
2016/03/10 21:05:13
Done.
| |
| 286 EXPECT_FALSE(result); | |
| 286 break; | 287 break; |
| 287 | 288 |
| 288 case MimeUtil::HEVC_MAIN: | 289 case MimeUtil::HEVC_MAIN: |
| 289 EXPECT_EQ(HasHevcSupport(), result); | 290 EXPECT_EQ(HasHevcSupport(), result); |
| 290 break; | 291 break; |
| 291 } | 292 } |
| 292 }); | 293 }); |
| 294 RunCodecSupportTest( | |
|
ddorwin
2016/03/10 18:16:54
Empty line.
Then explain the purpose of this in a
kqyang
2016/03/10 21:05:13
Removed. No longer needed.
| |
| 295 states_to_vary, test_states, | |
| 296 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { | |
| 297 const bool result = MimeUtil::IsCodecSupportedOnPlatform( | |
| 298 codec, "video/webm", true, info); | |
| 299 if (codec == MimeUtil::VP9) | |
| 300 EXPECT_EQ(info.supports_vp9, result); | |
| 301 }); | |
| 293 } | 302 } |
| 294 | 303 |
| 295 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithAndroidPipeline) { | 304 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithAndroidPipeline) { |
| 296 // Vary all parameters except |is_unified_media_pipeline_enabled|. | 305 // Vary all parameters except |is_unified_media_pipeline_enabled|. |
| 297 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); | 306 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); |
| 298 states_to_vary.is_unified_media_pipeline_enabled = false; | 307 states_to_vary.is_unified_media_pipeline_enabled = false; |
| 299 | 308 |
| 300 // Disable the unified pipeline. | 309 // Disable the unified pipeline. |
| 301 MimeUtil::PlatformInfo test_states; | 310 MimeUtil::PlatformInfo test_states; |
| 302 test_states.is_unified_media_pipeline_enabled = false; | 311 test_states.is_unified_media_pipeline_enabled = false; |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 329 case MimeUtil::VP8: | 338 case MimeUtil::VP8: |
| 330 EXPECT_TRUE(result); | 339 EXPECT_TRUE(result); |
| 331 break; | 340 break; |
| 332 | 341 |
| 333 // The remaining codecs depend on the platform version. | 342 // The remaining codecs depend on the platform version. |
| 334 case MimeUtil::OPUS: | 343 case MimeUtil::OPUS: |
| 335 EXPECT_EQ(info.supports_opus, result); | 344 EXPECT_EQ(info.supports_opus, result); |
| 336 break; | 345 break; |
| 337 | 346 |
| 338 case MimeUtil::VP9: | 347 case MimeUtil::VP9: |
| 339 EXPECT_EQ(info.supports_vp9, result); | 348 // VP9 is only supported with WebM. |
|
ddorwin
2016/03/10 18:16:54
MediaPlayer only supports VP9 in WebM.
| |
| 349 EXPECT_FALSE(result); | |
| 340 break; | 350 break; |
| 341 | 351 |
| 342 case MimeUtil::HEVC_MAIN: | 352 case MimeUtil::HEVC_MAIN: |
| 343 EXPECT_EQ(HasHevcSupport(), result); | 353 EXPECT_EQ(HasHevcSupport(), result); |
| 344 break; | 354 break; |
| 345 } | 355 } |
| 346 }); | 356 }); |
| 357 RunCodecSupportTest( | |
|
ddorwin
2016/03/10 18:16:53
ditto
kqyang
2016/03/10 21:05:13
Done.
| |
| 358 states_to_vary, test_states, | |
| 359 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { | |
| 360 const bool result = MimeUtil::IsCodecSupportedOnPlatform( | |
| 361 codec, "video/webm", true, info); | |
| 362 if (codec == MimeUtil::VP9) | |
| 363 EXPECT_EQ(info.supports_vp9, result); | |
| 364 }); | |
| 347 } | 365 } |
| 348 | 366 |
| 349 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithUnifiedPipeline) { | 367 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithUnifiedPipeline) { |
| 350 // Vary all parameters except |is_unified_media_pipeline_enabled|. | 368 // Vary all parameters except |is_unified_media_pipeline_enabled|. |
| 351 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); | 369 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); |
| 352 states_to_vary.is_unified_media_pipeline_enabled = false; | 370 states_to_vary.is_unified_media_pipeline_enabled = false; |
| 353 | 371 |
| 354 // Enable the unified pipeline. | 372 // Enable the unified pipeline. |
| 355 MimeUtil::PlatformInfo test_states; | 373 MimeUtil::PlatformInfo test_states; |
| 356 test_states.is_unified_media_pipeline_enabled = true; | 374 test_states.is_unified_media_pipeline_enabled = true; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 406 states_to_vary, test_states, | 424 states_to_vary, test_states, |
| 407 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { | 425 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { |
| 408 EXPECT_EQ(info.is_unified_media_pipeline_enabled, | 426 EXPECT_EQ(info.is_unified_media_pipeline_enabled, |
| 409 MimeUtil::IsCodecSupportedOnPlatform( | 427 MimeUtil::IsCodecSupportedOnPlatform( |
| 410 MimeUtil::OPUS, "audio/ogg", false, info)); | 428 MimeUtil::OPUS, "audio/ogg", false, info)); |
| 411 }); | 429 }); |
| 412 } | 430 } |
| 413 | 431 |
| 414 } // namespace internal | 432 } // namespace internal |
| 415 } // namespace media | 433 } // namespace media |
| OLD | NEW |