| OLD | NEW |
| 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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 ResourceMessageCallParams error_params(encoder.get(), 0); | 636 ResourceMessageCallParams error_params(encoder.get(), 0); |
| 637 SendNotifyError(error_params, PP_ERROR_FAILED); | 637 SendNotifyError(error_params, PP_ERROR_FAILED); |
| 638 ASSERT_TRUE(cb.called()); | 638 ASSERT_TRUE(cb.called()); |
| 639 ASSERT_EQ(PP_ERROR_FAILED, cb.result()); | 639 ASSERT_EQ(PP_ERROR_FAILED, cb.result()); |
| 640 } | 640 } |
| 641 } | 641 } |
| 642 | 642 |
| 643 TEST_F(VideoEncoderResourceTest, InitializeSuccess) { | 643 TEST_F(VideoEncoderResourceTest, InitializeSuccess) { |
| 644 { | 644 { |
| 645 // Verify the initialize callback is called when initialization is | 645 // Verify the initialize callback is called when initialization is |
| 646 // successfull. | 646 // successful. |
| 647 LockingResourceReleaser encoder(CreateEncoder()); | 647 LockingResourceReleaser encoder(CreateEncoder()); |
| 648 ResourceMessageCallParams params; | 648 ResourceMessageCallParams params; |
| 649 PP_Size size = kFrameSize; | 649 PP_Size size = kFrameSize; |
| 650 const uint32_t kBitrate = 420000; | 650 const uint32_t kBitrate = 420000; |
| 651 MockCompletionCallback cb; | 651 MockCompletionCallback cb; |
| 652 int32_t result = encoder_iface()->Initialize( | 652 int32_t result = encoder_iface()->Initialize( |
| 653 encoder.get(), PP_VIDEOFRAME_FORMAT_I420, &size, | 653 encoder.get(), PP_VIDEOFRAME_FORMAT_I420, &size, |
| 654 PP_VIDEOPROFILE_H264MAIN, kBitrate, | 654 PP_VIDEOPROFILE_H264MAIN, kBitrate, |
| 655 PP_HARDWAREACCELERATION_WITHFALLBACK, | 655 PP_HARDWAREACCELERATION_WITHFALLBACK, |
| 656 PP_MakeOptionalCompletionCallback(&MockCompletionCallback::Callback, | 656 PP_MakeOptionalCompletionCallback(&MockCompletionCallback::Callback, |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 ResourceMessageCallParams params; | 1142 ResourceMessageCallParams params; |
| 1143 uint32_t frame_id; | 1143 uint32_t frame_id; |
| 1144 bool force_frame; | 1144 bool force_frame; |
| 1145 ASSERT_TRUE(CheckEncodeMsg(¶ms, &frame_id, &force_frame)); | 1145 ASSERT_TRUE(CheckEncodeMsg(¶ms, &frame_id, &force_frame)); |
| 1146 SendEncodeReply(params, frame_id); | 1146 SendEncodeReply(params, frame_id); |
| 1147 } | 1147 } |
| 1148 } | 1148 } |
| 1149 | 1149 |
| 1150 } // namespace proxy | 1150 } // namespace proxy |
| 1151 } // namespace ppapi | 1151 } // namespace ppapi |
| OLD | NEW |