OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 .Times(AtLeast(1)); | 62 .Times(AtLeast(1)); |
63 EXPECT_CALL(frame_reader_mock_, NumberOfFrames()).WillOnce(Return(1)); | 63 EXPECT_CALL(frame_reader_mock_, NumberOfFrames()).WillOnce(Return(1)); |
64 EXPECT_CALL(frame_reader_mock_, FrameLength()).WillOnce(Return(152064)); | 64 EXPECT_CALL(frame_reader_mock_, FrameLength()).WillOnce(Return(152064)); |
65 } | 65 } |
66 }; | 66 }; |
67 | 67 |
68 TEST_F(VideoProcessorTest, Init) { | 68 TEST_F(VideoProcessorTest, Init) { |
69 ExpectInit(); | 69 ExpectInit(); |
70 VideoProcessorImpl video_processor( | 70 VideoProcessorImpl video_processor( |
71 &encoder_mock_, &decoder_mock_, &frame_reader_mock_, &frame_writer_mock_, | 71 &encoder_mock_, &decoder_mock_, &frame_reader_mock_, &frame_writer_mock_, |
72 &packet_manipulator_mock_, config_, &stats_, | 72 &packet_manipulator_mock_, config_, &stats_); |
73 nullptr /* source_frame_writer */, nullptr /* encoded_frame_writer */, | |
74 nullptr /* decoded_frame_writer */); | |
75 ASSERT_TRUE(video_processor.Init()); | 73 ASSERT_TRUE(video_processor.Init()); |
76 } | 74 } |
77 | 75 |
78 TEST_F(VideoProcessorTest, ProcessFrame) { | 76 TEST_F(VideoProcessorTest, ProcessFrame) { |
79 ExpectInit(); | 77 ExpectInit(); |
80 EXPECT_CALL(encoder_mock_, Encode(_, _, _)).Times(1); | 78 EXPECT_CALL(encoder_mock_, Encode(_, _, _)).Times(1); |
81 EXPECT_CALL(frame_reader_mock_, ReadFrame()) | 79 EXPECT_CALL(frame_reader_mock_, ReadFrame()) |
82 .WillOnce(Return(I420Buffer::Create(50, 50))); | 80 .WillOnce(Return(I420Buffer::Create(50, 50))); |
83 // Since we don't return any callback from the mock, the decoder will not | 81 // Since we don't return any callback from the mock, the decoder will not |
84 // be more than initialized... | 82 // be more than initialized... |
85 VideoProcessorImpl video_processor( | 83 VideoProcessorImpl video_processor( |
86 &encoder_mock_, &decoder_mock_, &frame_reader_mock_, &frame_writer_mock_, | 84 &encoder_mock_, &decoder_mock_, &frame_reader_mock_, &frame_writer_mock_, |
87 &packet_manipulator_mock_, config_, &stats_, | 85 &packet_manipulator_mock_, config_, &stats_); |
88 nullptr /* source_frame_writer */, nullptr /* encoded_frame_writer */, | |
89 nullptr /* decoded_frame_writer */); | |
90 ASSERT_TRUE(video_processor.Init()); | 86 ASSERT_TRUE(video_processor.Init()); |
91 video_processor.ProcessFrame(0); | 87 video_processor.ProcessFrame(0); |
92 } | 88 } |
93 | 89 |
94 } // namespace test | 90 } // namespace test |
95 } // namespace webrtc | 91 } // namespace webrtc |
OLD | NEW |