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

Side by Side Diff: ppapi/proxy/video_encoder_resource_unittest.cc

Issue 1069653002: ppapi: VideoEncoder: fix reported value for GetSupportedProfiles() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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 "base/memory/shared_memory.h" 5 #include "base/memory/shared_memory.h"
6 #include "base/process/process.h" 6 #include "base/process/process.h"
7 #include "base/synchronization/waitable_event.h" 7 #include "base/synchronization/waitable_event.h"
8 #include "ppapi/c/pp_codecs.h" 8 #include "ppapi/c/pp_codecs.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/ppb_video_encoder.h" 10 #include "ppapi/c/ppb_video_encoder.h"
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 profiles_response.push_back(profile); 455 profiles_response.push_back(profile);
456 profile.profile = PP_VIDEOPROFILE_VP8_ANY; 456 profile.profile = PP_VIDEOPROFILE_VP8_ANY;
457 profile.max_resolution.width = 1920; 457 profile.max_resolution.width = 1920;
458 profile.max_resolution.height = 1080; 458 profile.max_resolution.height = 1080;
459 profile.max_framerate_numerator = 30; 459 profile.max_framerate_numerator = 30;
460 profile.max_framerate_denominator = 1; 460 profile.max_framerate_denominator = 1;
461 profile.acceleration = PP_HARDWAREACCELERATION_NONE; 461 profile.acceleration = PP_HARDWAREACCELERATION_NONE;
462 profiles_response.push_back(profile); 462 profiles_response.push_back(profile);
463 463
464 SendGetSupportedProfilesReply(params, profiles_response); 464 SendGetSupportedProfilesReply(params, profiles_response);
465 ASSERT_EQ(PP_OK, cb.result()); 465 ASSERT_EQ(profiles_response.size(), static_cast<uint32_t>(cb.result()));
466 466 ASSERT_EQ(0, memcmp(&profiles[0], &profiles_response[0], sizeof(profiles)));
467 ASSERT_EQ(2U, profiles_response.size());
468 ASSERT_EQ(0, memcmp(&profiles[0], &profiles_response[0],
469 sizeof(PP_VideoProfileDescription) * 2));
470 } 467 }
471 } 468 }
472 469
473 TEST_F(VideoEncoderResourceTest, InitializeFailure) { 470 TEST_F(VideoEncoderResourceTest, InitializeFailure) {
474 { 471 {
475 // Verify the initialize callback is called in case of failure. 472 // Verify the initialize callback is called in case of failure.
476 LockingResourceReleaser encoder(CreateEncoder()); 473 LockingResourceReleaser encoder(CreateEncoder());
477 ResourceMessageCallParams params; 474 ResourceMessageCallParams params;
478 PP_Size size = kFrameSize; 475 PP_Size size = kFrameSize;
479 MockCompletionCallback cb; 476 MockCompletionCallback cb;
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 ASSERT_EQ(PP_ERROR_ABORTED, encode_cb1.result()); 1073 ASSERT_EQ(PP_ERROR_ABORTED, encode_cb1.result());
1077 ASSERT_TRUE(encode_cb2.called()); 1074 ASSERT_TRUE(encode_cb2.called());
1078 ASSERT_EQ(PP_ERROR_ABORTED, encode_cb2.result()); 1075 ASSERT_EQ(PP_ERROR_ABORTED, encode_cb2.result());
1079 ASSERT_TRUE(get_bitstream_buffer_cb.called()); 1076 ASSERT_TRUE(get_bitstream_buffer_cb.called());
1080 ASSERT_EQ(PP_ERROR_ABORTED, get_bitstream_buffer_cb.result()); 1077 ASSERT_EQ(PP_ERROR_ABORTED, get_bitstream_buffer_cb.result());
1081 } 1078 }
1082 } 1079 }
1083 1080
1084 } // namespace proxy 1081 } // namespace proxy
1085 } // namespace ppapi 1082 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698