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

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

Issue 10451087: for readability review. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: modify comments Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/renderer/media/video_capture_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bind.h" 5 #include "base/bind.h"
6 #include "content/common/child_process.h"
6 #include "content/renderer/media/capture_video_decoder.h" 7 #include "content/renderer/media/capture_video_decoder.h"
7 #include "content/renderer/media/video_capture_impl.h" 8 #include "content/renderer/media/video_capture_impl.h"
8 #include "content/renderer/media/video_capture_impl_manager.h" 9 #include "content/renderer/media/video_capture_impl_manager.h"
9 #include "media/base/limits.h" 10 #include "media/base/limits.h"
10 #include "media/base/mock_callback.h" 11 #include "media/base/mock_callback.h"
11 #include "media/base/mock_filters.h" 12 #include "media/base/mock_filters.h"
12 #include "media/base/pipeline_status.h" 13 #include "media/base/pipeline_status.h"
13 #include "media/video/capture/video_capture_types.h" 14 #include "media/video/capture/video_capture_types.h"
14 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
15 16
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 capability.interlaced = false; 97 capability.interlaced = false;
97 98
98 decoder_ = new CaptureVideoDecoder(message_loop_proxy_, 99 decoder_ = new CaptureVideoDecoder(message_loop_proxy_,
99 kVideoStreamId, vc_manager_, capability); 100 kVideoStreamId, vc_manager_, capability);
100 EXPECT_CALL(statistics_cb_object_, OnStatistics(_)) 101 EXPECT_CALL(statistics_cb_object_, OnStatistics(_))
101 .Times(AnyNumber()); 102 .Times(AnyNumber());
102 103
103 read_cb_ = base::Bind(&CaptureVideoDecoderTest::FrameReady, 104 read_cb_ = base::Bind(&CaptureVideoDecoderTest::FrameReady,
104 base::Unretained(this)); 105 base::Unretained(this));
105 106
107 child_process_.reset(new ChildProcess());
106 vc_impl_.reset(new MockVideoCaptureImpl( 108 vc_impl_.reset(new MockVideoCaptureImpl(
107 kVideoStreamId, message_loop_proxy_, new VideoCaptureMessageFilter())); 109 kVideoStreamId, message_loop_proxy_, new VideoCaptureMessageFilter()));
108 } 110 }
109 111
110 virtual ~CaptureVideoDecoderTest() { 112 virtual ~CaptureVideoDecoderTest() {
111 message_loop_->RunAllPending(); 113 message_loop_->RunAllPending();
112 } 114 }
113 115
114 media::StatisticsCB NewStatisticsCB() { 116 media::StatisticsCB NewStatisticsCB() {
115 return base::Bind(&media::MockStatisticsCB::OnStatistics, 117 return base::Bind(&media::MockStatisticsCB::OnStatistics,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 media::VideoCapture::EventHandler* capture_client() { 154 media::VideoCapture::EventHandler* capture_client() {
153 return static_cast<media::VideoCapture::EventHandler*>(decoder_); 155 return static_cast<media::VideoCapture::EventHandler*>(decoder_);
154 } 156 }
155 157
156 MOCK_METHOD2(FrameReady, void(media::VideoDecoder::DecoderStatus status, 158 MOCK_METHOD2(FrameReady, void(media::VideoDecoder::DecoderStatus status,
157 const scoped_refptr<media::VideoFrame>&)); 159 const scoped_refptr<media::VideoFrame>&));
158 160
159 // Fixture members. 161 // Fixture members.
160 scoped_refptr<CaptureVideoDecoder> decoder_; 162 scoped_refptr<CaptureVideoDecoder> decoder_;
161 scoped_refptr<MockVideoCaptureImplManager> vc_manager_; 163 scoped_refptr<MockVideoCaptureImplManager> vc_manager_;
164 scoped_ptr<ChildProcess> child_process_;
162 scoped_ptr<MockVideoCaptureImpl> vc_impl_; 165 scoped_ptr<MockVideoCaptureImpl> vc_impl_;
163 media::MockStatisticsCB statistics_cb_object_; 166 media::MockStatisticsCB statistics_cb_object_;
164 scoped_ptr<MessageLoop> message_loop_; 167 scoped_ptr<MessageLoop> message_loop_;
165 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; 168 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
166 media::VideoDecoder::ReadCB read_cb_; 169 media::VideoDecoder::ReadCB read_cb_;
167 170
168 private: 171 private:
169 DISALLOW_COPY_AND_ASSIGN(CaptureVideoDecoderTest); 172 DISALLOW_COPY_AND_ASSIGN(CaptureVideoDecoderTest);
170 }; 173 };
171 174
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 215
213 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, _)).Times(2); 216 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, _)).Times(2);
214 decoder_->Read(read_cb_); 217 decoder_->Read(read_cb_);
215 decoder_->PrepareForShutdownHack(); 218 decoder_->PrepareForShutdownHack();
216 decoder_->Read(read_cb_); 219 decoder_->Read(read_cb_);
217 message_loop_->RunAllPending(); 220 message_loop_->RunAllPending();
218 221
219 Stop(); 222 Stop();
220 } 223 }
221 224
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/video_capture_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698