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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "content/renderer/media/capture_video_decoder.h" | 6 #include "content/renderer/media/capture_video_decoder.h" |
7 #include "content/renderer/media/video_capture_impl.h" | 7 #include "content/renderer/media/video_capture_impl.h" |
8 #include "content/renderer/media/video_capture_impl_manager.h" | 8 #include "content/renderer/media/video_capture_impl_manager.h" |
9 #include "media/base/filters.h" | 9 #include "media/base/filters.h" |
10 #include "media/base/limits.h" | 10 #include "media/base/limits.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 media::StatisticsCallback NewStatisticsCallback() { | 116 media::StatisticsCallback NewStatisticsCallback() { |
117 return base::Bind(&media::MockStatisticsCallback::OnStatistics, | 117 return base::Bind(&media::MockStatisticsCallback::OnStatistics, |
118 base::Unretained(&statistics_callback_object_)); | 118 base::Unretained(&statistics_callback_object_)); |
119 } | 119 } |
120 | 120 |
121 void Initialize() { | 121 void Initialize() { |
122 EXPECT_CALL(*vc_manager_, AddDevice(_, _)) | 122 EXPECT_CALL(*vc_manager_, AddDevice(_, _)) |
123 .WillOnce(Return(vc_impl_.get())); | 123 .WillOnce(Return(vc_impl_.get())); |
124 decoder_->Initialize(NULL, | 124 decoder_->Initialize(NULL, |
125 media::NewExpectedClosure(), | 125 media::NewExpectedStatusCB(media::PIPELINE_OK), |
126 NewStatisticsCallback()); | 126 NewStatisticsCallback()); |
127 message_loop_->RunAllPending(); | 127 message_loop_->RunAllPending(); |
128 } | 128 } |
129 | 129 |
130 void Start() { | 130 void Start() { |
131 // Issue a read. | 131 // Issue a read. |
132 EXPECT_CALL(*this, FrameReady(_)); | 132 EXPECT_CALL(*this, FrameReady(_)); |
133 decoder_->Read(read_cb_); | 133 decoder_->Read(read_cb_); |
134 | 134 |
135 // Issue a seek. | 135 // Issue a seek. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 227 |
228 EXPECT_CALL(host_, SetNaturalVideoSize(expected_size)); | 228 EXPECT_CALL(host_, SetNaturalVideoSize(expected_size)); |
229 decoder_->OnDeviceInfoReceived(vc_impl_.get(), params); | 229 decoder_->OnDeviceInfoReceived(vc_impl_.get(), params); |
230 message_loop_->RunAllPending(); | 230 message_loop_->RunAllPending(); |
231 | 231 |
232 EXPECT_EQ(expected_size.width(), decoder_->natural_size().width()); | 232 EXPECT_EQ(expected_size.width(), decoder_->natural_size().width()); |
233 EXPECT_EQ(expected_size.height(), decoder_->natural_size().height()); | 233 EXPECT_EQ(expected_size.height(), decoder_->natural_size().height()); |
234 | 234 |
235 Stop(); | 235 Stop(); |
236 } | 236 } |
OLD | NEW |