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

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

Issue 2640113004: Introduce Dolby Vision video codec and Demuxer support (Closed)
Patch Set: fix CQ failure Created 3 years, 10 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 #if defined(OS_ANDROID) 104 #if defined(OS_ANDROID)
105 return base::android::BuildInfo::GetInstance()->sdk_int() >= 21; 105 return base::android::BuildInfo::GetInstance()->sdk_int() >= 21;
106 #else 106 #else
107 return true; 107 return true;
108 #endif // defined(OS_ANDROID) 108 #endif // defined(OS_ANDROID)
109 #else 109 #else
110 return false; 110 return false;
111 #endif // BUILDFLAG(ENABLE_HEVC_DEMUXING) 111 #endif // BUILDFLAG(ENABLE_HEVC_DEMUXING)
112 } 112 }
113 113
114 // This is to validate MimeUtil::IsCodecSupportedOnPlatform(), which is used
115 // only on Android platform.
116 static bool HasDolbyVisionSupport() {
117 return false;
118 }
119
114 TEST(MimeUtilTest, CommonMediaMimeType) { 120 TEST(MimeUtilTest, CommonMediaMimeType) {
115 EXPECT_TRUE(IsSupportedMediaMimeType("audio/webm")); 121 EXPECT_TRUE(IsSupportedMediaMimeType("audio/webm"));
116 EXPECT_TRUE(IsSupportedMediaMimeType("video/webm")); 122 EXPECT_TRUE(IsSupportedMediaMimeType("video/webm"));
117 123
118 EXPECT_TRUE(IsSupportedMediaMimeType("audio/wav")); 124 EXPECT_TRUE(IsSupportedMediaMimeType("audio/wav"));
119 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-wav")); 125 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-wav"));
120 126
121 EXPECT_TRUE(IsSupportedMediaMimeType("audio/flac")); 127 EXPECT_TRUE(IsSupportedMediaMimeType("audio/flac"));
122 128
123 EXPECT_TRUE(IsSupportedMediaMimeType("audio/ogg")); 129 EXPECT_TRUE(IsSupportedMediaMimeType("audio/ogg"));
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 EXPECT_EQ(info.has_platform_vp8_decoder, result); 283 EXPECT_EQ(info.has_platform_vp8_decoder, result);
278 break; 284 break;
279 285
280 case MimeUtil::VP9: 286 case MimeUtil::VP9:
281 EXPECT_EQ(info.has_platform_vp9_decoder, result); 287 EXPECT_EQ(info.has_platform_vp9_decoder, result);
282 break; 288 break;
283 289
284 case MimeUtil::HEVC: 290 case MimeUtil::HEVC:
285 EXPECT_EQ(HasHevcSupport(), result); 291 EXPECT_EQ(HasHevcSupport(), result);
286 break; 292 break;
293
294 case MimeUtil::DolbyVision:
295 EXPECT_EQ(HasDolbyVisionSupport(), result);
296 break;
287 } 297 }
288 }); 298 });
289 } 299 }
290 300
291 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehavior) { 301 TEST(IsCodecSupportedOnPlatformTest, ClearCodecBehavior) {
292 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); 302 MimeUtil::PlatformInfo states_to_vary = VaryAllFields();
293 303
294 MimeUtil::PlatformInfo test_states; 304 MimeUtil::PlatformInfo test_states;
295 305
296 RunCodecSupportTest( 306 RunCodecSupportTest(
(...skipping 24 matching lines...) Expand all
321 break; 331 break;
322 332
323 // These codecs are only supported if platform decoders are supported. 333 // These codecs are only supported if platform decoders are supported.
324 case MimeUtil::H264: 334 case MimeUtil::H264:
325 EXPECT_EQ(info.has_platform_decoders, result); 335 EXPECT_EQ(info.has_platform_decoders, result);
326 break; 336 break;
327 337
328 case MimeUtil::HEVC: 338 case MimeUtil::HEVC:
329 EXPECT_EQ(HasHevcSupport() && info.has_platform_decoders, result); 339 EXPECT_EQ(HasHevcSupport() && info.has_platform_decoders, result);
330 break; 340 break;
341
342 case MimeUtil::DolbyVision:
343 EXPECT_EQ(HasDolbyVisionSupport(), result);
344 break;
331 } 345 }
332 }); 346 });
333 } 347 }
334 348
335 TEST(IsCodecSupportedOnPlatformTest, OpusOggSupport) { 349 TEST(IsCodecSupportedOnPlatformTest, OpusOggSupport) {
336 // Vary all parameters; thus use default initial state. 350 // Vary all parameters; thus use default initial state.
337 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); 351 MimeUtil::PlatformInfo states_to_vary = VaryAllFields();
338 MimeUtil::PlatformInfo test_states; 352 MimeUtil::PlatformInfo test_states;
339 353
340 RunCodecSupportTest( 354 RunCodecSupportTest(
(...skipping 18 matching lines...) Expand all
359 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info)); 373 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info));
360 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( 374 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform(
361 MimeUtil::MPEG2_AAC, "audio/mpegurl", false, info)); 375 MimeUtil::MPEG2_AAC, "audio/mpegurl", false, info));
362 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( 376 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform(
363 MimeUtil::MPEG2_AAC, "audio/x-mpegurl", false, info)); 377 MimeUtil::MPEG2_AAC, "audio/x-mpegurl", false, info));
364 }); 378 });
365 } 379 }
366 380
367 } // namespace internal 381 } // namespace internal
368 } // namespace media 382 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698