OLD | NEW |
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 "content/renderer/media/rtc_video_decoder.h" | 5 #include "content/renderer/media/rtc_video_decoder.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 182 } |
183 | 183 |
184 virtual ~RTCVideoDecoderTest() { | 184 virtual ~RTCVideoDecoderTest() { |
185 } | 185 } |
186 | 186 |
187 virtual void SetUp() OVERRIDE { | 187 virtual void SetUp() OVERRIDE { |
188 video_track_ = MockVideoTrack::Create(); | 188 video_track_ = MockVideoTrack::Create(); |
189 decoder_ = new RTCVideoDecoder(message_loop_.message_loop_proxy(), | 189 decoder_ = new RTCVideoDecoder(message_loop_.message_loop_proxy(), |
190 message_loop_.message_loop_proxy(), | 190 message_loop_.message_loop_proxy(), |
191 video_track_); | 191 video_track_); |
| 192 renderer_ = new MockVideoRenderer(); |
192 read_cb_ = base::Bind(&RTCVideoDecoderTest::FrameReady, | 193 read_cb_ = base::Bind(&RTCVideoDecoderTest::FrameReady, |
193 base::Unretained(this)); | 194 base::Unretained(this)); |
194 | 195 |
195 DCHECK(decoder_); | 196 DCHECK(decoder_); |
196 | 197 |
197 EXPECT_CALL(statistics_cb_, OnStatistics(_)) | 198 EXPECT_CALL(statistics_cb_, OnStatistics(_)) |
198 .Times(AnyNumber()); | 199 .Times(AnyNumber()); |
199 } | 200 } |
200 | 201 |
201 virtual void TearDown() OVERRIDE { | 202 virtual void TearDown() OVERRIDE { |
(...skipping 27 matching lines...) Expand all Loading... |
229 NullVideoFrame video_frame; | 230 NullVideoFrame video_frame; |
230 decoder_->RenderFrame(&video_frame); | 231 decoder_->RenderFrame(&video_frame); |
231 } | 232 } |
232 | 233 |
233 MOCK_METHOD2(FrameReady, void(media::VideoDecoder::Status status, | 234 MOCK_METHOD2(FrameReady, void(media::VideoDecoder::Status status, |
234 const scoped_refptr<media::VideoFrame>&)); | 235 const scoped_refptr<media::VideoFrame>&)); |
235 | 236 |
236 // Fixture members. | 237 // Fixture members. |
237 scoped_refptr<MockVideoTrack> video_track_; | 238 scoped_refptr<MockVideoTrack> video_track_; |
238 scoped_refptr<RTCVideoDecoder> decoder_; | 239 scoped_refptr<RTCVideoDecoder> decoder_; |
| 240 scoped_refptr<MockVideoRenderer> renderer_; |
239 MockStatisticsCB statistics_cb_; | 241 MockStatisticsCB statistics_cb_; |
240 MessageLoop message_loop_; | 242 MessageLoop message_loop_; |
241 media::VideoDecoder::ReadCB read_cb_; | 243 media::VideoDecoder::ReadCB read_cb_; |
242 | 244 |
243 private: | 245 private: |
244 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoderTest); | 246 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoderTest); |
245 }; | 247 }; |
246 | 248 |
247 const int RTCVideoDecoderTest::kWidth = 640; | 249 const int RTCVideoDecoderTest::kWidth = 640; |
248 const int RTCVideoDecoderTest::kHeight = 480; | 250 const int RTCVideoDecoderTest::kHeight = 480; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 Stop(); | 331 Stop(); |
330 | 332 |
331 // Any read after stopping should be immediately satisfied. | 333 // Any read after stopping should be immediately satisfied. |
332 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, | 334 EXPECT_CALL(*this, FrameReady(media::VideoDecoder::kOk, |
333 scoped_refptr<media::VideoFrame>())); | 335 scoped_refptr<media::VideoFrame>())); |
334 decoder_->Read(read_cb_); | 336 decoder_->Read(read_cb_); |
335 message_loop_.RunUntilIdle(); | 337 message_loop_.RunUntilIdle(); |
336 } | 338 } |
337 | 339 |
338 } // namespace content | 340 } // namespace content |
OLD | NEW |