| 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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "content/child/child_process.h" | 6 #include "content/child/child_process.h" |
| 7 #include "content/common/media/video_capture_messages.h" | 7 #include "content/common/media/video_capture_messages.h" |
| 8 #include "content/renderer/media/video_capture_impl.h" | 8 #include "content/renderer/media/video_capture_impl.h" |
| 9 #include "media/base/bind_to_current_loop.h" | 9 #include "media/base/bind_to_current_loop.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 video_capture_impl_.reset(new MockVideoCaptureImpl( | 122 video_capture_impl_.reset(new MockVideoCaptureImpl( |
| 123 session_id_, message_filter_.get())); | 123 session_id_, message_filter_.get())); |
| 124 | 124 |
| 125 video_capture_impl_->device_id_ = 2; | 125 video_capture_impl_->device_id_ = 2; |
| 126 } | 126 } |
| 127 | 127 |
| 128 virtual ~VideoCaptureImplTest() { | 128 virtual ~VideoCaptureImplTest() { |
| 129 } | 129 } |
| 130 | 130 |
| 131 protected: | 131 protected: |
| 132 MOCK_METHOD2(OnFrameReady, | 132 MOCK_METHOD3(OnFrameReady, |
| 133 void(const scoped_refptr<media::VideoFrame>&, | 133 void(const scoped_refptr<media::VideoFrame>&, |
| 134 const media::VideoCaptureFormat&)); | 134 const media::VideoCaptureFormat&, |
| 135 const base::TimeTicks&)); |
| 135 MOCK_METHOD1(OnStateUpdate, void(VideoCaptureState)); | 136 MOCK_METHOD1(OnStateUpdate, void(VideoCaptureState)); |
| 136 MOCK_METHOD1(OnDeviceFormatsInUse, | 137 MOCK_METHOD1(OnDeviceFormatsInUse, |
| 137 void(const media::VideoCaptureFormats&)); | 138 void(const media::VideoCaptureFormats&)); |
| 138 MOCK_METHOD1(OnDeviceSupportedFormats, | 139 MOCK_METHOD1(OnDeviceSupportedFormats, |
| 139 void(const media::VideoCaptureFormats&)); | 140 void(const media::VideoCaptureFormats&)); |
| 140 | 141 |
| 141 void Init() { | 142 void Init() { |
| 142 video_capture_impl_->Init(); | 143 video_capture_impl_->Init(); |
| 143 } | 144 } |
| 144 | 145 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 StartCapture(0, params_small_); | 304 StartCapture(0, params_small_); |
| 304 | 305 |
| 305 // Receive state change message from browser. | 306 // Receive state change message from browser. |
| 306 video_capture_impl_->ReceiveStateChangeMessage(VIDEO_CAPTURE_STATE_ERROR); | 307 video_capture_impl_->ReceiveStateChangeMessage(VIDEO_CAPTURE_STATE_ERROR); |
| 307 | 308 |
| 308 StopCapture(0); | 309 StopCapture(0); |
| 309 DeInit(); | 310 DeInit(); |
| 310 } | 311 } |
| 311 | 312 |
| 312 } // namespace content | 313 } // namespace content |
| OLD | NEW |