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

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

Issue 2640113004: Introduce Dolby Vision video codec and Demuxer support (Closed)
Patch Set: fix build break on Android Created 3 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
« no previous file with comments | « media/base/mime_util_internal.cc ('k') | media/base/video_codecs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 EXPECT_EQ(info.has_platform_vp8_decoder, result); 282 EXPECT_EQ(info.has_platform_vp8_decoder, result);
277 break; 283 break;
278 284
279 case MimeUtil::VP9: 285 case MimeUtil::VP9:
280 EXPECT_EQ(info.has_platform_vp9_decoder, result); 286 EXPECT_EQ(info.has_platform_vp9_decoder, result);
281 break; 287 break;
282 288
283 case MimeUtil::HEVC: 289 case MimeUtil::HEVC:
284 EXPECT_EQ(HasHevcSupport(), result); 290 EXPECT_EQ(HasHevcSupport(), result);
285 break; 291 break;
292
293 case MimeUtil::DOLBY_VISION:
294 EXPECT_EQ(HasDolbyVisionSupport(), result);
295 break;
286 } 296 }
287 }); 297 });
288 } 298 }
289 299
290 TEST(IsCodecSupportedOnAndroidTest, ClearCodecBehavior) { 300 TEST(IsCodecSupportedOnAndroidTest, ClearCodecBehavior) {
291 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); 301 MimeUtil::PlatformInfo states_to_vary = VaryAllFields();
292 302
293 MimeUtil::PlatformInfo test_states; 303 MimeUtil::PlatformInfo test_states;
294 304
295 RunCodecSupportTest( 305 RunCodecSupportTest(
(...skipping 24 matching lines...) Expand all
320 break; 330 break;
321 331
322 // These codecs are only supported if platform decoders are supported. 332 // These codecs are only supported if platform decoders are supported.
323 case MimeUtil::H264: 333 case MimeUtil::H264:
324 EXPECT_EQ(info.has_platform_decoders, result); 334 EXPECT_EQ(info.has_platform_decoders, result);
325 break; 335 break;
326 336
327 case MimeUtil::HEVC: 337 case MimeUtil::HEVC:
328 EXPECT_EQ(HasHevcSupport() && info.has_platform_decoders, result); 338 EXPECT_EQ(HasHevcSupport() && info.has_platform_decoders, result);
329 break; 339 break;
340
341 case MimeUtil::DOLBY_VISION:
342 EXPECT_EQ(HasDolbyVisionSupport(), result);
343 break;
330 } 344 }
331 }); 345 });
332 } 346 }
333 347
334 TEST(IsCodecSupportedOnAndroidTest, OpusOggSupport) { 348 TEST(IsCodecSupportedOnAndroidTest, OpusOggSupport) {
335 // Vary all parameters; thus use default initial state. 349 // Vary all parameters; thus use default initial state.
336 MimeUtil::PlatformInfo states_to_vary = VaryAllFields(); 350 MimeUtil::PlatformInfo states_to_vary = VaryAllFields();
337 MimeUtil::PlatformInfo test_states; 351 MimeUtil::PlatformInfo test_states;
338 352
339 RunCodecSupportTest( 353 RunCodecSupportTest(
(...skipping 18 matching lines...) Expand all
358 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info)); 372 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info));
359 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnAndroid( 373 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnAndroid(
360 MimeUtil::MPEG2_AAC, "audio/mpegurl", false, info)); 374 MimeUtil::MPEG2_AAC, "audio/mpegurl", false, info));
361 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnAndroid( 375 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnAndroid(
362 MimeUtil::MPEG2_AAC, "audio/x-mpegurl", false, info)); 376 MimeUtil::MPEG2_AAC, "audio/x-mpegurl", false, info));
363 }); 377 });
364 } 378 }
365 379
366 } // namespace internal 380 } // namespace internal
367 } // namespace media 381 } // namespace media
OLDNEW
« no previous file with comments | « media/base/mime_util_internal.cc ('k') | media/base/video_codecs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698