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

Side by Side Diff: content/renderer/media/video_track_recorder_unittest.cc

Issue 1884383002: VideoTrackRecorder: Adding inner class H264Encoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hbos@ comments: adding explicit dep to openh264 in content.gyp and content/renderer/BUILD.gn Created 4 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
« no previous file with comments | « content/renderer/media/video_track_recorder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/renderer/media/video_track_recorder.h" 5 #include "content/renderer/media/video_track_recorder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 23 matching lines...) Expand all
34 using ::testing::TestWithParam; 34 using ::testing::TestWithParam;
35 using ::testing::ValuesIn; 35 using ::testing::ValuesIn;
36 36
37 namespace content { 37 namespace content {
38 38
39 ACTION_P(RunClosure, closure) { 39 ACTION_P(RunClosure, closure) {
40 closure.Run(); 40 closure.Run();
41 } 41 }
42 42
43 const VideoTrackRecorder::CodecId kTrackRecorderTestCodec[] = { 43 const VideoTrackRecorder::CodecId kTrackRecorderTestCodec[] = {
44 VideoTrackRecorder::CodecId::VP8, VideoTrackRecorder::CodecId::VP9}; 44 VideoTrackRecorder::CodecId::VP8,
45 VideoTrackRecorder::CodecId::VP9
46 #if BUILDFLAG(RTC_USE_H264)
47 , VideoTrackRecorder::CodecId::H264
48 #endif
49 };
45 50
46 class VideoTrackRecorderTest 51 class VideoTrackRecorderTest
47 : public TestWithParam<VideoTrackRecorder::CodecId> { 52 : public TestWithParam<VideoTrackRecorder::CodecId> {
48 public: 53 public:
49 VideoTrackRecorderTest() 54 VideoTrackRecorderTest()
50 : mock_source_(new MockMediaStreamVideoSource(false)) { 55 : mock_source_(new MockMediaStreamVideoSource(false)) {
51 const blink::WebString webkit_track_id(base::UTF8ToUTF16("dummy")); 56 const blink::WebString webkit_track_id(base::UTF8ToUTF16("dummy"));
52 blink_source_.initialize(webkit_track_id, 57 blink_source_.initialize(webkit_track_id,
53 blink::WebMediaStreamSource::TypeVideo, 58 blink::WebMediaStreamSource::TypeVideo,
54 webkit_track_id); 59 webkit_track_id);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 163
159 base::StringPiece third_frame_encoded_data; 164 base::StringPiece third_frame_encoded_data;
160 EXPECT_CALL(*this, DoOnEncodedVideo(video_frame2, _, _, true)) 165 EXPECT_CALL(*this, DoOnEncodedVideo(video_frame2, _, _, true))
161 .Times(1) 166 .Times(1)
162 .WillOnce(DoAll(SaveArg<1>(&third_frame_encoded_data), 167 .WillOnce(DoAll(SaveArg<1>(&third_frame_encoded_data),
163 RunClosure(quit_closure))); 168 RunClosure(quit_closure)));
164 Encode(video_frame2, base::TimeTicks::Now()); 169 Encode(video_frame2, base::TimeTicks::Now());
165 170
166 run_loop.Run(); 171 run_loop.Run();
167 172
168 const size_t kEncodedSizeThreshold = 18; 173 const size_t kEncodedSizeThreshold = 14;
169 EXPECT_GE(first_frame_encoded_data.size(), kEncodedSizeThreshold); 174 EXPECT_GE(first_frame_encoded_data.size(), kEncodedSizeThreshold);
170 EXPECT_GE(second_frame_encoded_data.size(), kEncodedSizeThreshold); 175 EXPECT_GE(second_frame_encoded_data.size(), kEncodedSizeThreshold);
171 EXPECT_GE(third_frame_encoded_data.size(), kEncodedSizeThreshold); 176 EXPECT_GE(third_frame_encoded_data.size(), kEncodedSizeThreshold);
172 177
173 Mock::VerifyAndClearExpectations(this); 178 Mock::VerifyAndClearExpectations(this);
174 } 179 }
175 180
176 INSTANTIATE_TEST_CASE_P(, 181 INSTANTIATE_TEST_CASE_P(,
177 VideoTrackRecorderTest, 182 VideoTrackRecorderTest,
178 ValuesIn(kTrackRecorderTestCodec)); 183 ValuesIn(kTrackRecorderTestCodec));
179 184
180 } // namespace content 185 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/video_track_recorder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698