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.h" | 5 #include "base/message_loop.h" |
6 #include "content/common/child_process.h" | 6 #include "content/common/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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 IPC_MESSAGE_UNHANDLED(handled = false) | 83 IPC_MESSAGE_UNHANDLED(handled = false) |
84 IPC_END_MESSAGE_MAP() | 84 IPC_END_MESSAGE_MAP() |
85 EXPECT_TRUE(handled); | 85 EXPECT_TRUE(handled); |
86 delete message; | 86 delete message; |
87 } | 87 } |
88 | 88 |
89 void DeviceStartCapture(int device_id, | 89 void DeviceStartCapture(int device_id, |
90 const media::VideoCaptureParams& params) { | 90 const media::VideoCaptureParams& params) { |
91 media::VideoCaptureParams device_info = params; | 91 media::VideoCaptureParams device_info = params; |
92 OnDeviceInfoReceived(device_info); | 92 OnDeviceInfoReceived(device_info); |
93 OnStateChanged(video_capture::kStarted); | 93 OnStateChanged(VIDEO_CAPTURE_STATE_STARTED); |
94 } | 94 } |
95 | 95 |
96 void DevicePauseCapture(int device_id) {} | 96 void DevicePauseCapture(int device_id) {} |
97 | 97 |
98 void DeviceStopCapture(int device_id) { | 98 void DeviceStopCapture(int device_id) { |
99 OnStateChanged(video_capture::kStopped); | 99 OnStateChanged(VIDEO_CAPTURE_STATE_STOPPED); |
100 } | 100 } |
101 | 101 |
102 void DeviceReceiveEmptyBuffer(int device_id, int buffer_id) {} | 102 void DeviceReceiveEmptyBuffer(int device_id, int buffer_id) {} |
103 }; | 103 }; |
104 | 104 |
105 VideoCaptureImplTest() { | 105 VideoCaptureImplTest() { |
106 message_loop_.reset(new MessageLoop(MessageLoop::TYPE_IO)); | 106 message_loop_.reset(new MessageLoop(MessageLoop::TYPE_IO)); |
107 message_loop_proxy_ = | 107 message_loop_proxy_ = |
108 base::MessageLoopProxy::current().get(); | 108 base::MessageLoopProxy::current().get(); |
109 child_process_.reset(new ChildProcess()); | 109 child_process_.reset(new ChildProcess()); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 .WillOnce(Return()); | 293 .WillOnce(Return()); |
294 EXPECT_CALL(*client2, OnRemoved(_)) | 294 EXPECT_CALL(*client2, OnRemoved(_)) |
295 .WillOnce(Return()); | 295 .WillOnce(Return()); |
296 | 296 |
297 video_capture_impl_->StopCapture(client1.get()); | 297 video_capture_impl_->StopCapture(client1.get()); |
298 video_capture_impl_->StopCapture(client2.get()); | 298 video_capture_impl_->StopCapture(client2.get()); |
299 message_loop_->RunAllPending(); | 299 message_loop_->RunAllPending(); |
300 } | 300 } |
301 | 301 |
302 } // namespace content | 302 } // namespace content |
OLD | NEW |