Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Side by Side Diff: media/base/mime_util_unittest.cc

Issue 1677133003: Implemented parsing of HEVC codec ids (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@parse-codec-id
Patch Set: Added vp9 reserved profiles to histograms.xml Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 EXPECT_EQ(info.supports_vp9, result);
286 break; 286 break;
287 287
288 case MimeUtil::HEVC_MAIN: 288 case MimeUtil::HEVC:
289 EXPECT_EQ(HasHevcSupport(), result); 289 EXPECT_EQ(HasHevcSupport(), result);
290 break; 290 break;
291 } 291 }
292 }); 292 });
293 } 293 }
294 294
295 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithAndroidPipeline) { 295 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithAndroidPipeline) {
296 // Vary all parameters except |is_unified_media_pipeline_enabled|. 296 // Vary all parameters except |is_unified_media_pipeline_enabled|.
297 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); 297 MimeUtil::PlatformInfo states_to_vary = VaryAllFields();
298 states_to_vary.is_unified_media_pipeline_enabled = false; 298 states_to_vary.is_unified_media_pipeline_enabled = false;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 // The remaining codecs depend on the platform version. 333 // The remaining codecs depend on the platform version.
334 case MimeUtil::OPUS: 334 case MimeUtil::OPUS:
335 EXPECT_EQ(info.supports_opus, result); 335 EXPECT_EQ(info.supports_opus, result);
336 break; 336 break;
337 337
338 case MimeUtil::VP9: 338 case MimeUtil::VP9:
339 EXPECT_EQ(info.supports_vp9, result); 339 EXPECT_EQ(info.supports_vp9, result);
340 break; 340 break;
341 341
342 case MimeUtil::HEVC_MAIN: 342 case MimeUtil::HEVC:
343 EXPECT_EQ(HasHevcSupport(), result); 343 EXPECT_EQ(HasHevcSupport(), result);
344 break; 344 break;
345 } 345 }
346 }); 346 });
347 } 347 }
348 348
349 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithUnifiedPipeline) { 349 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehaviorWithUnifiedPipeline) {
350 // Vary all parameters except |is_unified_media_pipeline_enabled|. 350 // Vary all parameters except |is_unified_media_pipeline_enabled|.
351 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); 351 MimeUtil::PlatformInfo states_to_vary = VaryAllFields();
352 states_to_vary.is_unified_media_pipeline_enabled = false; 352 states_to_vary.is_unified_media_pipeline_enabled = false;
(...skipping 30 matching lines...) Expand all
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;
404 404
405 RunCodecSupportTest( 405 RunCodecSupportTest(
406 states_to_vary, test_states, 406 states_to_vary, test_states,
407 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { 407 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) {
408 EXPECT_EQ(info.is_unified_media_pipeline_enabled, 408 EXPECT_EQ(info.is_unified_media_pipeline_enabled,
409 MimeUtil::IsCodecSupportedOnPlatform( 409 MimeUtil::IsCodecSupportedOnPlatform(
410 MimeUtil::OPUS, "audio/ogg", false, info)); 410 MimeUtil::OPUS, "audio/ogg", false, info));
411 }); 411 });
412 } 412 }
413 413
414 } // namespace internal 414 } // namespace internal
415 } // namespace media 415 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698