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