| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 break; | 274 break; |
| 275 | 275 |
| 276 case MimeUtil::VP8: | 276 case MimeUtil::VP8: |
| 277 EXPECT_EQ(info.has_platform_vp8_decoder, result); | 277 EXPECT_EQ(info.has_platform_vp8_decoder, result); |
| 278 break; | 278 break; |
| 279 | 279 |
| 280 case MimeUtil::VP9: | 280 case MimeUtil::VP9: |
| 281 EXPECT_EQ(info.supports_vp9, result); | 281 EXPECT_EQ(info.supports_vp9, result); |
| 282 break; | 282 break; |
| 283 | 283 |
| 284 case MimeUtil::HEVC_MAIN: | 284 case MimeUtil::HEVC: |
| 285 EXPECT_EQ(HasHevcSupport(), result); | 285 EXPECT_EQ(HasHevcSupport(), result); |
| 286 break; | 286 break; |
| 287 } | 287 } |
| 288 }); | 288 }); |
| 289 } | 289 } |
| 290 | 290 |
| 291 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithAndroidPipeline) { | 291 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithAndroidPipeline) { |
| 292 // Vary all parameters except |is_unified_media_pipeline_enabled|. | 292 // Vary all parameters except |is_unified_media_pipeline_enabled|. |
| 293 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); | 293 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); |
| 294 states_to_vary.is_unified_media_pipeline_enabled = false; | 294 states_to_vary.is_unified_media_pipeline_enabled = false; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 324 | 324 |
| 325 // The remaining codecs depend on the platform version. | 325 // The remaining codecs depend on the platform version. |
| 326 case MimeUtil::OPUS: | 326 case MimeUtil::OPUS: |
| 327 EXPECT_EQ(info.supports_opus, result); | 327 EXPECT_EQ(info.supports_opus, result); |
| 328 break; | 328 break; |
| 329 | 329 |
| 330 case MimeUtil::VP9: | 330 case MimeUtil::VP9: |
| 331 EXPECT_EQ(info.supports_vp9, result); | 331 EXPECT_EQ(info.supports_vp9, result); |
| 332 break; | 332 break; |
| 333 | 333 |
| 334 case MimeUtil::HEVC_MAIN: | 334 case MimeUtil::HEVC: |
| 335 EXPECT_EQ(HasHevcSupport(), result); | 335 EXPECT_EQ(HasHevcSupport(), result); |
| 336 break; | 336 break; |
| 337 } | 337 } |
| 338 }); | 338 }); |
| 339 } | 339 } |
| 340 | 340 |
| 341 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithUnifiedPipeline) { | 341 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithUnifiedPipeline) { |
| 342 // Vary all parameters except |is_unified_media_pipeline_enabled|. | 342 // Vary all parameters except |is_unified_media_pipeline_enabled|. |
| 343 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); | 343 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); |
| 344 states_to_vary.is_unified_media_pipeline_enabled = false; | 344 states_to_vary.is_unified_media_pipeline_enabled = false; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 371 case MimeUtil::VP8: | 371 case MimeUtil::VP8: |
| 372 case MimeUtil::VP9: | 372 case MimeUtil::VP9: |
| 373 EXPECT_TRUE(result); | 373 EXPECT_TRUE(result); |
| 374 break; | 374 break; |
| 375 | 375 |
| 376 // These codecs are only supported if platform decoders are supported. | 376 // These codecs are only supported if platform decoders are supported. |
| 377 case MimeUtil::H264: | 377 case MimeUtil::H264: |
| 378 EXPECT_EQ(info.has_platform_decoders, result); | 378 EXPECT_EQ(info.has_platform_decoders, result); |
| 379 break; | 379 break; |
| 380 | 380 |
| 381 case MimeUtil::HEVC_MAIN: | 381 case MimeUtil::HEVC: |
| 382 EXPECT_EQ(HasHevcSupport() && info.has_platform_decoders, result); | 382 EXPECT_EQ(HasHevcSupport() && info.has_platform_decoders, result); |
| 383 break; | 383 break; |
| 384 } | 384 } |
| 385 }); | 385 }); |
| 386 } | 386 } |
| 387 | 387 |
| 388 TEST(IsCodecSupportedOnPlatformTest, OpusOggSupport) { | 388 TEST(IsCodecSupportedOnPlatformTest, OpusOggSupport) { |
| 389 // Vary all parameters; thus use default initial state. | 389 // Vary all parameters; thus use default initial state. |
| 390 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); | 390 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); |
| 391 MimeUtil::PlatformInfo test_states; | 391 MimeUtil::PlatformInfo test_states; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 409 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { | 409 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { |
| 410 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( | 410 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( |
| 411 MimeUtil::MPEG2_AAC, "application/x-mpegurl", false, info)); | 411 MimeUtil::MPEG2_AAC, "application/x-mpegurl", false, info)); |
| 412 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( | 412 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( |
| 413 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info)); | 413 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info)); |
| 414 }); | 414 }); |
| 415 } | 415 } |
| 416 | 416 |
| 417 } // namespace internal | 417 } // namespace internal |
| 418 } // namespace media | 418 } // namespace media |
| OLD | NEW |