OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 16 matching lines...) Expand all Loading... |
27 using ::testing::Return; | 27 using ::testing::Return; |
28 using ::testing::ReturnNull; | 28 using ::testing::ReturnNull; |
29 using ::testing::SetArgumentPointee; | 29 using ::testing::SetArgumentPointee; |
30 using ::testing::StrictMock; | 30 using ::testing::StrictMock; |
31 using ::testing::WithArg; | 31 using ::testing::WithArg; |
32 using ::testing::Invoke; | 32 using ::testing::Invoke; |
33 using media::MockStatisticsCallback; | 33 using media::MockStatisticsCallback; |
34 using media::MockVideoRenderer; | 34 using media::MockVideoRenderer; |
35 using media::MockFilterHost; | 35 using media::MockFilterHost; |
36 using media::NewExpectedClosure; | 36 using media::NewExpectedClosure; |
37 using media::NewExpectedStatusCB; | |
38 using media::PipelineStatistics; | 37 using media::PipelineStatistics; |
39 using media::PIPELINE_OK; | 38 using media::PIPELINE_OK; |
40 using media::StatisticsCallback; | 39 using media::StatisticsCallback; |
41 | 40 |
42 namespace { | 41 namespace { |
43 | 42 |
44 class NullVideoFrame : public cricket::VideoFrame { | 43 class NullVideoFrame : public cricket::VideoFrame { |
45 public: | 44 public: |
46 NullVideoFrame() {}; | 45 NullVideoFrame() {}; |
47 virtual ~NullVideoFrame() {}; | 46 virtual ~NullVideoFrame() {}; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 .Times(AnyNumber()); | 125 .Times(AnyNumber()); |
127 } | 126 } |
128 | 127 |
129 virtual ~RTCVideoDecoderTest() { | 128 virtual ~RTCVideoDecoderTest() { |
130 // Finish up any remaining tasks. | 129 // Finish up any remaining tasks. |
131 message_loop_.RunAllPending(); | 130 message_loop_.RunAllPending(); |
132 } | 131 } |
133 | 132 |
134 void InitializeDecoderSuccessfully() { | 133 void InitializeDecoderSuccessfully() { |
135 // Test successful initialization. | 134 // Test successful initialization. |
136 decoder_->Initialize( | 135 decoder_->Initialize(NULL, |
137 NULL, NewExpectedStatusCB(PIPELINE_OK), NewStatisticsCallback()); | 136 NewExpectedClosure(), NewStatisticsCallback()); |
138 message_loop_.RunAllPending(); | 137 message_loop_.RunAllPending(); |
139 } | 138 } |
140 | 139 |
141 StatisticsCallback NewStatisticsCallback() { | 140 StatisticsCallback NewStatisticsCallback() { |
142 return base::Bind(&MockStatisticsCallback::OnStatistics, | 141 return base::Bind(&MockStatisticsCallback::OnStatistics, |
143 base::Unretained(&stats_callback_object_)); | 142 base::Unretained(&stats_callback_object_)); |
144 } | 143 } |
145 | 144 |
146 MOCK_METHOD1(FrameReady, void(scoped_refptr<media::VideoFrame>)); | 145 MOCK_METHOD1(FrameReady, void(scoped_refptr<media::VideoFrame>)); |
147 | 146 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 EXPECT_CALL(host_, | 223 EXPECT_CALL(host_, |
225 SetNaturalVideoSize(new_natural_size)).WillRepeatedly(Return()); | 224 SetNaturalVideoSize(new_natural_size)).WillRepeatedly(Return()); |
226 | 225 |
227 decoder_->SetSize(new_width, new_height, new_reserved); | 226 decoder_->SetSize(new_width, new_height, new_reserved); |
228 | 227 |
229 EXPECT_EQ(new_width, decoder_->natural_size().width()); | 228 EXPECT_EQ(new_width, decoder_->natural_size().width()); |
230 EXPECT_EQ(new_height, decoder_->natural_size().height()); | 229 EXPECT_EQ(new_height, decoder_->natural_size().height()); |
231 | 230 |
232 message_loop_.RunAllPending(); | 231 message_loop_.RunAllPending(); |
233 } | 232 } |
OLD | NEW |