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 "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 OnStateChanged(VIDEO_CAPTURE_STATE_STOPPED); | 93 OnStateChanged(VIDEO_CAPTURE_STATE_STOPPED); |
94 } | 94 } |
95 | 95 |
96 void DeviceReceiveEmptyBuffer(int device_id, int buffer_id) {} | 96 void DeviceReceiveEmptyBuffer(int device_id, int buffer_id) {} |
97 }; | 97 }; |
98 | 98 |
99 VideoCaptureImplTest() | 99 VideoCaptureImplTest() |
100 : capability_small_(176, | 100 : capability_small_(176, |
101 144, | 101 144, |
102 30, | 102 30, |
103 media::VideoCaptureCapability::kI420, | 103 media::PIXEL_FORMAT_I420, |
104 0, | 104 0, |
105 false, | 105 false, |
106 media::ConstantResolutionVideoCaptureDevice), | 106 media::ConstantResolutionVideoCaptureDevice), |
107 capability_large_(320, | 107 capability_large_(320, |
108 240, | 108 240, |
109 30, | 109 30, |
110 media::VideoCaptureCapability::kI420, | 110 media::PIXEL_FORMAT_I420, |
111 0, | 111 0, |
112 false, | 112 false, |
113 media::ConstantResolutionVideoCaptureDevice) { | 113 media::ConstantResolutionVideoCaptureDevice) { |
114 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_IO)); | 114 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_IO)); |
115 message_loop_proxy_ = base::MessageLoopProxy::current().get(); | 115 message_loop_proxy_ = base::MessageLoopProxy::current().get(); |
116 child_process_.reset(new ChildProcess()); | 116 child_process_.reset(new ChildProcess()); |
117 | 117 |
118 message_filter_ = new MockVideoCaptureMessageFilter; | 118 message_filter_ = new MockVideoCaptureMessageFilter; |
119 session_id_ = 1; | 119 session_id_ = 1; |
120 | 120 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 .WillOnce(Return()); | 294 .WillOnce(Return()); |
295 EXPECT_CALL(*client2, OnRemoved(_)) | 295 EXPECT_CALL(*client2, OnRemoved(_)) |
296 .WillOnce(Return()); | 296 .WillOnce(Return()); |
297 | 297 |
298 video_capture_impl_->StopCapture(client1.get()); | 298 video_capture_impl_->StopCapture(client1.get()); |
299 video_capture_impl_->StopCapture(client2.get()); | 299 video_capture_impl_->StopCapture(client2.get()); |
300 message_loop_->RunUntilIdle(); | 300 message_loop_->RunUntilIdle(); |
301 } | 301 } |
302 | 302 |
303 } // namespace content | 303 } // namespace content |
OLD | NEW |