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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 private: | 81 private: |
82 DISALLOW_COPY_AND_ASSIGN(MockVideoCaptureImplManager); | 82 DISALLOW_COPY_AND_ASSIGN(MockVideoCaptureImplManager); |
83 }; | 83 }; |
84 | 84 |
85 class CaptureVideoDecoderTest : public ::testing::Test { | 85 class CaptureVideoDecoderTest : public ::testing::Test { |
86 protected: | 86 protected: |
87 CaptureVideoDecoderTest() { | 87 CaptureVideoDecoderTest() { |
88 message_loop_.reset(new MessageLoop(MessageLoop::TYPE_IO)); | 88 message_loop_.reset(new MessageLoop(MessageLoop::TYPE_IO)); |
89 message_loop_proxy_ = | 89 message_loop_proxy_ = |
90 base::MessageLoopProxy::CreateForCurrentThread().get(); | 90 base::MessageLoopProxy::current().get(); |
91 vc_manager_ = new MockVideoCaptureImplManager(); | 91 vc_manager_ = new MockVideoCaptureImplManager(); |
92 media::VideoCapture::VideoCaptureCapability capability; | 92 media::VideoCapture::VideoCaptureCapability capability; |
93 capability.width = 176; | 93 capability.width = 176; |
94 capability.height = 144; | 94 capability.height = 144; |
95 capability.max_fps = 30; | 95 capability.max_fps = 30; |
96 capability.expected_capture_delay = 0; | 96 capability.expected_capture_delay = 0; |
97 capability.raw_type = media::VideoFrame::I420; | 97 capability.raw_type = media::VideoFrame::I420; |
98 capability.interlaced = false; | 98 capability.interlaced = false; |
99 capability.resolution_fixed = false; | 99 capability.resolution_fixed = false; |
100 | 100 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 message_loop_->RunAllPending(); | 163 message_loop_->RunAllPending(); |
164 | 164 |
165 EXPECT_CALL(*vc_impl, StopCapture(capture_client)) | 165 EXPECT_CALL(*vc_impl, StopCapture(capture_client)) |
166 .Times(1) | 166 .Times(1) |
167 .WillOnce(CaptureStopped(capture_client, vc_impl.get())); | 167 .WillOnce(CaptureStopped(capture_client, vc_impl.get())); |
168 EXPECT_CALL(*vc_manager_, RemoveDevice(_, _)) | 168 EXPECT_CALL(*vc_manager_, RemoveDevice(_, _)) |
169 .WillOnce(Return()); | 169 .WillOnce(Return()); |
170 decoder_->Stop(media::NewExpectedCallback()); | 170 decoder_->Stop(media::NewExpectedCallback()); |
171 message_loop_->RunAllPending(); | 171 message_loop_->RunAllPending(); |
172 } | 172 } |
OLD | NEW |