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

Unified Diff: media/base/mime_util_unittest.cc

Issue 2808373002: Fix PlatformInfo variation for mime util IsCodecSupportedOnAndroidTest (Closed)
Patch Set: add blank line above RUN_TEST_VECTOR_XXX undefs Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/mime_util_unittest.cc
diff --git a/media/base/mime_util_unittest.cc b/media/base/mime_util_unittest.cc
index 5e0f598e48374e10471056d9ecb82b2e5077e7dd..a23d9da6fea0b91d61254eef75628d50e4366764 100644
--- a/media/base/mime_util_unittest.cc
+++ b/media/base/mime_util_unittest.cc
@@ -64,15 +64,17 @@ static void RunCodecSupportTest(const MimeUtil::PlatformInfo& states_to_vary,
MimeUtil::PlatformInfo info;
-#define RUN_TEST_VECTOR(name) \
- size_t name##_index = 0; \
- for (info.name = name##_states[name##_index]; \
- name##_index < name##_states.size(); ++name##_index)
-
- RUN_TEST_VECTOR(has_platform_decoders) {
- RUN_TEST_VECTOR(has_platform_vp8_decoder) {
- RUN_TEST_VECTOR(has_platform_vp9_decoder) {
- RUN_TEST_VECTOR(supports_opus) {
+#define RUN_TEST_VECTOR_BEGIN(name) \
+ for (size_t name##_index = 0; \
+ name##_index < name##_states.size(); \
+ ++name##_index) { \
+ info.name = name##_states[name##_index];
+#define RUN_TEST_VECTOR_END() }
+
+ RUN_TEST_VECTOR_BEGIN(has_platform_decoders)
+ RUN_TEST_VECTOR_BEGIN(has_platform_vp8_decoder)
+ RUN_TEST_VECTOR_BEGIN(has_platform_vp9_decoder)
+ RUN_TEST_VECTOR_BEGIN(supports_opus)
for (int codec = MimeUtil::INVALID_CODEC;
codec <= MimeUtil::LAST_CODEC; ++codec) {
SCOPED_TRACE(base::StringPrintf(
@@ -84,11 +86,13 @@ static void RunCodecSupportTest(const MimeUtil::PlatformInfo& states_to_vary,
info.supports_opus, info.has_platform_vp9_decoder, codec));
test_func(info, static_cast<MimeUtil::Codec>(codec));
}
- }
- }
- }
- }
-#undef RUN_TEST_VECTOR
+ RUN_TEST_VECTOR_END()
+ RUN_TEST_VECTOR_END()
+ RUN_TEST_VECTOR_END()
+ RUN_TEST_VECTOR_END()
+
+#undef RUN_TEST_VECTOR_BEGIN
+#undef RUN_TEST_VECTOR_END
}
// Helper method for generating the |states_to_vary| value used by
@@ -333,6 +337,7 @@ TEST(IsCodecSupportedOnAndroidTest, ClearCodecBehavior) {
// These codecs are always supported with the unified pipeline.
case MimeUtil::FLAC:
+ case MimeUtil::H264:
case MimeUtil::PCM:
case MimeUtil::MPEG2_AAC:
case MimeUtil::MP3:
@@ -345,10 +350,6 @@ TEST(IsCodecSupportedOnAndroidTest, ClearCodecBehavior) {
break;
// These codecs are only supported if platform decoders are supported.
- case MimeUtil::H264:
- EXPECT_EQ(info.has_platform_decoders, result);
- break;
-
case MimeUtil::HEVC:
EXPECT_EQ(HasHevcSupport() && info.has_platform_decoders, result);
break;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698