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

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

Issue 2700493006: Add optional visualization file writers to VideoProcessor tests. (Closed)
Patch Set: kjellander comments 2. Created 3 years, 10 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 */);
73 ASSERT_TRUE(video_processor.Init()); 75 ASSERT_TRUE(video_processor.Init());
74 } 76 }
75 77
76 TEST_F(VideoProcessorTest, ProcessFrame) { 78 TEST_F(VideoProcessorTest, ProcessFrame) {
77 ExpectInit(); 79 ExpectInit();
78 EXPECT_CALL(encoder_mock_, Encode(_, _, _)).Times(1); 80 EXPECT_CALL(encoder_mock_, Encode(_, _, _)).Times(1);
79 EXPECT_CALL(frame_reader_mock_, ReadFrame()) 81 EXPECT_CALL(frame_reader_mock_, ReadFrame())
80 .WillOnce(Return(I420Buffer::Create(50, 50))); 82 .WillOnce(Return(I420Buffer::Create(50, 50)));
81 // Since we don't return any callback from the mock, the decoder will not 83 // Since we don't return any callback from the mock, the decoder will not
82 // be more than initialized... 84 // be more than initialized...
83 VideoProcessorImpl video_processor( 85 VideoProcessorImpl video_processor(
84 &encoder_mock_, &decoder_mock_, &frame_reader_mock_, &frame_writer_mock_, 86 &encoder_mock_, &decoder_mock_, &frame_reader_mock_, &frame_writer_mock_,
85 &packet_manipulator_mock_, config_, &stats_); 87 &packet_manipulator_mock_, config_, &stats_,
88 nullptr /* source_frame_writer */, nullptr /* encoded_frame_writer */,
89 nullptr /* decoded_frame_writer */);
86 ASSERT_TRUE(video_processor.Init()); 90 ASSERT_TRUE(video_processor.Init());
87 video_processor.ProcessFrame(0); 91 video_processor.ProcessFrame(0);
88 } 92 }
89 93
90 } // namespace test 94 } // namespace test
91 } // namespace webrtc 95 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698