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

Side by Side Diff: webrtc/modules/video_coding/codecs/test/videoprocessor_unittest.cc

Issue 2362683002: New helper function test::ReadI420Buffer, refactor FrameReader to use it. (Closed)
Patch Set: Another try to fix the 64-bit windows build. Created 4 years, 2 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 /* 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 ExpectInit(); 68 ExpectInit();
69 VideoProcessorImpl video_processor( 69 VideoProcessorImpl video_processor(
70 &encoder_mock_, &decoder_mock_, &frame_reader_mock_, &frame_writer_mock_, 70 &encoder_mock_, &decoder_mock_, &frame_reader_mock_, &frame_writer_mock_,
71 &packet_manipulator_mock_, config_, &stats_); 71 &packet_manipulator_mock_, config_, &stats_);
72 ASSERT_TRUE(video_processor.Init()); 72 ASSERT_TRUE(video_processor.Init());
73 } 73 }
74 74
75 TEST_F(VideoProcessorTest, ProcessFrame) { 75 TEST_F(VideoProcessorTest, ProcessFrame) {
76 ExpectInit(); 76 ExpectInit();
77 EXPECT_CALL(encoder_mock_, Encode(_, _, _)).Times(1); 77 EXPECT_CALL(encoder_mock_, Encode(_, _, _)).Times(1);
78 EXPECT_CALL(frame_reader_mock_, ReadFrame(_)).WillOnce(Return(true)); 78 EXPECT_CALL(frame_reader_mock_, ReadFrame())
79 .WillOnce(Return(I420Buffer::Create(50, 50)));
79 // Since we don't return any callback from the mock, the decoder will not 80 // Since we don't return any callback from the mock, the decoder will not
80 // be more than initialized... 81 // be more than initialized...
81 VideoProcessorImpl video_processor( 82 VideoProcessorImpl video_processor(
82 &encoder_mock_, &decoder_mock_, &frame_reader_mock_, &frame_writer_mock_, 83 &encoder_mock_, &decoder_mock_, &frame_reader_mock_, &frame_writer_mock_,
83 &packet_manipulator_mock_, config_, &stats_); 84 &packet_manipulator_mock_, config_, &stats_);
84 ASSERT_TRUE(video_processor.Init()); 85 ASSERT_TRUE(video_processor.Init());
85 video_processor.ProcessFrame(0); 86 video_processor.ProcessFrame(0);
86 } 87 }
87 88
88 } // namespace test 89 } // namespace test
89 } // namespace webrtc 90 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698