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 // Unit test for VideoCaptureController. | 5 // Unit test for VideoCaptureController. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 scoped_refptr<VideoCaptureController> controller_; | 94 scoped_refptr<VideoCaptureController> controller_; |
95 MessageLoop* message_loop_; | 95 MessageLoop* message_loop_; |
96 VideoCaptureControllerID controller_id_; | 96 VideoCaptureControllerID controller_id_; |
97 base::ProcessHandle process_handle_; | 97 base::ProcessHandle process_handle_; |
98 }; | 98 }; |
99 | 99 |
100 class MockVideoCaptureManager | 100 class MockVideoCaptureManager |
101 : public media_stream::VideoCaptureManager { | 101 : public media_stream::VideoCaptureManager { |
102 public: | 102 public: |
103 MockVideoCaptureManager() | 103 MockVideoCaptureManager() |
104 : video_session_id_(kStartOpenSessionId) {} | 104 : VideoCaptureManager(content::MEDIA_VIDEO_DEVICE_CAPTURE), |
no longer working on chromium
2012/09/05 14:19:41
why do we create a VideoCaptureManager here?
miu
2012/09/06 04:40:35
Nothing new is being created. The base class cons
| |
105 video_session_id_(kStartOpenSessionId) {} | |
105 | 106 |
106 void Init() { | 107 void Init() { |
107 device_name_.unique_id = "/dev/video0"; | 108 device_name_.unique_id = "/dev/video0"; |
108 device_name_.device_name = "fake_device_0"; | 109 device_name_.device_name = "fake_device_0"; |
109 | 110 |
110 video_capture_device_.reset( | 111 video_capture_device_.reset( |
111 media::FakeVideoCaptureDevice::Create(device_name_)); | 112 media::FakeVideoCaptureDevice::Create(device_name_)); |
112 ASSERT_TRUE(video_capture_device_.get() != NULL); | 113 ASSERT_TRUE(video_capture_device_.get() != NULL); |
113 } | 114 } |
114 | 115 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
261 message_loop_->PostDelayedTask( | 262 message_loop_->PostDelayedTask( |
262 FROM_HERE, MessageLoop::QuitClosure(), base::TimeDelta::FromSeconds(1)); | 263 FROM_HERE, MessageLoop::QuitClosure(), base::TimeDelta::FromSeconds(1)); |
263 message_loop_->Run(); | 264 message_loop_->Run(); |
264 | 265 |
265 EXPECT_CALL(*vcm_, | 266 EXPECT_CALL(*vcm_, |
266 StopCapture(vcm_->video_session_id_)) | 267 StopCapture(vcm_->video_session_id_)) |
267 .Times(1); | 268 .Times(1); |
268 controller_->StopCapture(controller_handler_->controller_id_, | 269 controller_->StopCapture(controller_handler_->controller_id_, |
269 controller_handler_.get()); | 270 controller_handler_.get()); |
270 } | 271 } |
OLD | NEW |