Index: ppapi/tests/test_video_encoder.cc |
diff --git a/ppapi/tests/test_video_encoder.cc b/ppapi/tests/test_video_encoder.cc |
index 4b2abf2a7764915f3bfaddae6e8ebb5237e9cd5f..58b8cc69268b995211a14a377b5566538bb5756a 100644 |
--- a/ppapi/tests/test_video_encoder.cc |
+++ b/ppapi/tests/test_video_encoder.cc |
@@ -21,7 +21,10 @@ void TestVideoEncoder::RunTests(const std::string& filter) { |
RUN_CALLBACK_TEST(TestVideoEncoder, AvailableCodecs, filter); |
RUN_CALLBACK_TEST(TestVideoEncoder, IncorrectSizeFails, filter); |
RUN_CALLBACK_TEST(TestVideoEncoder, InitializeVP8, filter); |
- RUN_CALLBACK_TEST(TestVideoEncoder, InitializeVP9, filter); |
+ RUN_CALLBACK_TEST(TestVideoEncoder, InitializeVP9_Profile0, filter); |
+ RUN_CALLBACK_TEST(TestVideoEncoder, InitializeVP9_Profile1, filter); |
+ RUN_CALLBACK_TEST(TestVideoEncoder, InitializeVP9_Profile2, filter); |
+ RUN_CALLBACK_TEST(TestVideoEncoder, InitializeVP9_Profile3, filter); |
} |
std::string TestVideoEncoder::TestAvailableCodecs() { |
ddorwin
2016/03/25 22:51:22
Should this test have ifdef'd tests for H.264? (No
servolk
2016/03/25 23:52:01
The only H.264 encoder that I could find in Chrome
ddorwin
2016/03/26 00:45:08
Thanks for checking.
|
@@ -41,7 +44,8 @@ std::string TestVideoEncoder::TestAvailableCodecs() { |
callback.output(); |
ASSERT_GE(video_profiles.size(), 1U); |
- bool found_vp8 = false, found_vp9 = false; |
+ bool found_vp8 = false; |
+ uint8_t found_vp9_profiles = 0; |
for (uint32_t i = 0; i < video_profiles.size(); ++i) { |
const PP_VideoProfileDescription& description = video_profiles[i]; |
if (description.hardware_accelerated == PP_FALSE) { |
@@ -50,12 +54,18 @@ std::string TestVideoEncoder::TestAvailableCodecs() { |
30U); |
if (description.profile == PP_VIDEOPROFILE_VP8_ANY) |
found_vp8 = true; |
- else if (description.profile == PP_VIDEOPROFILE_VP9_ANY) |
- found_vp9 = true; |
+ else if (description.profile == PP_VIDEOPROFILE_VP9_PROFILE0) |
+ found_vp9_profiles |= 1; |
+ else if (description.profile == PP_VIDEOPROFILE_VP9_PROFILE1) |
+ found_vp9_profiles |= (1 << 1); |
+ else if (description.profile == PP_VIDEOPROFILE_VP9_PROFILE2) |
+ found_vp9_profiles |= (1 << 2); |
+ else if (description.profile == PP_VIDEOPROFILE_VP9_PROFILE3) |
+ found_vp9_profiles |= (1 << 3); |
} |
} |
ASSERT_TRUE(found_vp8); |
- ASSERT_TRUE(found_vp9); |
+ ASSERT_EQ(0xf, found_vp9_profiles); |
PASS(); |
} |
@@ -80,8 +90,20 @@ std::string TestVideoEncoder::TestInitializeVP8() { |
return TestInitializeCodec(PP_VIDEOPROFILE_VP8_ANY); |
} |
-std::string TestVideoEncoder::TestInitializeVP9() { |
- return TestInitializeCodec(PP_VIDEOPROFILE_VP9_ANY); |
+std::string TestVideoEncoder::TestInitializeVP9_Profile0() { |
+ return TestInitializeCodec(PP_VIDEOPROFILE_VP9_PROFILE0); |
+} |
+ |
+std::string TestVideoEncoder::TestInitializeVP9_Profile1() { |
+ return TestInitializeCodec(PP_VIDEOPROFILE_VP9_PROFILE1); |
+} |
+ |
+std::string TestVideoEncoder::TestInitializeVP9_Profile2() { |
+ return TestInitializeCodec(PP_VIDEOPROFILE_VP9_PROFILE2); |
+} |
+ |
+std::string TestVideoEncoder::TestInitializeVP9_Profile3() { |
+ return TestInitializeCodec(PP_VIDEOPROFILE_VP9_PROFILE2); |
ddorwin
2016/03/25 22:51:22
s/2/3/
servolk
2016/03/25 23:52:01
Done.
|
} |
std::string TestVideoEncoder::TestInitializeCodec(PP_VideoProfile profile) { |