diff options
-rw-r--r-- | native_client_sdk/src/examples/api/video_encode/video_encode.cc | 2 | ||||
-rw-r--r-- | ppapi/examples/video_encode/video_encode.cc | 2 | ||||
-rw-r--r-- | ppapi/proxy/video_encoder_resource.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/video_encoder_resource_unittest.cc | 7 | ||||
-rw-r--r-- | ppapi/tests/test_video_encoder.cc | 2 |
5 files changed, 7 insertions, 9 deletions
diff --git a/native_client_sdk/src/examples/api/video_encode/video_encode.cc b/native_client_sdk/src/examples/api/video_encode/video_encode.cc index 702786c..806bca4 100644 --- a/native_client_sdk/src/examples/api/video_encode/video_encode.cc +++ b/native_client_sdk/src/examples/api/video_encode/video_encode.cc @@ -281,7 +281,7 @@ void VideoEncoderInstance::OnEncoderProbed( pp::VarArray js_profiles; dict.Set(pp::Var("profiles"), js_profiles); - if (result != PP_OK) { + if (result < 0) { LogError(result, "Cannot get supported profiles"); PostMessage(dict); } diff --git a/ppapi/examples/video_encode/video_encode.cc b/ppapi/examples/video_encode/video_encode.cc index 66d141a..c6a0921 100644 --- a/ppapi/examples/video_encode/video_encode.cc +++ b/ppapi/examples/video_encode/video_encode.cc @@ -288,7 +288,7 @@ void VideoEncoderInstance::OnEncoderProbed( pp::VarArray js_profiles; dict.Set(pp::Var("profiles"), js_profiles); - if (result != PP_OK) { + if (result < 0) { LogError(result, "Cannot get supported profiles"); PostMessage(dict); } diff --git a/ppapi/proxy/video_encoder_resource.cc b/ppapi/proxy/video_encoder_resource.cc index d337b7b..5f21662 100644 --- a/ppapi/proxy/video_encoder_resource.cc +++ b/ppapi/proxy/video_encoder_resource.cc @@ -267,7 +267,8 @@ void VideoEncoderResource::OnPluginMsgGetSupportedProfilesReply( return; } - RunCallback(&get_supported_profiles_callback_, PP_OK); + RunCallback(&get_supported_profiles_callback_, + base::checked_cast<int32_t>(profiles.size())); } void VideoEncoderResource::OnPluginMsgInitializeReply( diff --git a/ppapi/proxy/video_encoder_resource_unittest.cc b/ppapi/proxy/video_encoder_resource_unittest.cc index 0adc1ea..cc7ecc8 100644 --- a/ppapi/proxy/video_encoder_resource_unittest.cc +++ b/ppapi/proxy/video_encoder_resource_unittest.cc @@ -462,11 +462,8 @@ TEST_F(VideoEncoderResourceTest, GetSupportedProfiles) { profiles_response.push_back(profile); SendGetSupportedProfilesReply(params, profiles_response); - ASSERT_EQ(PP_OK, cb.result()); - - ASSERT_EQ(2U, profiles_response.size()); - ASSERT_EQ(0, memcmp(&profiles[0], &profiles_response[0], - sizeof(PP_VideoProfileDescription) * 2)); + ASSERT_EQ(profiles_response.size(), static_cast<uint32_t>(cb.result())); + ASSERT_EQ(0, memcmp(&profiles[0], &profiles_response[0], sizeof(profiles))); } } diff --git a/ppapi/tests/test_video_encoder.cc b/ppapi/tests/test_video_encoder.cc index 2a57473..95e8667 100644 --- a/ppapi/tests/test_video_encoder.cc +++ b/ppapi/tests/test_video_encoder.cc @@ -32,7 +32,7 @@ std::string TestVideoEncoder::TestCreate() { callback.WaitForResult( video_encoder.GetSupportedProfiles(callback.GetCallback())); - ASSERT_EQ(PP_OK, callback.result()); + ASSERT_GE(callback.result(), 1U); const std::vector<PP_VideoProfileDescription> video_profiles = callback.output(); |