OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <sys/fcntl.h> | 5 #include <sys/fcntl.h> |
6 #include <sys/ioctl.h> | 6 #include <sys/ioctl.h> |
7 | 7 |
8 #include "base/files/file_enumerator.h" | 8 #include "base/files/file_enumerator.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 DoOnIncomingCapturedVideoFrame(); | 180 DoOnIncomingCapturedVideoFrame(); |
181 } | 181 } |
182 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); | 182 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); |
183 MOCK_METHOD4( | 183 MOCK_METHOD4( |
184 ResurrectLastOutputBuffer, | 184 ResurrectLastOutputBuffer, |
185 Buffer(const gfx::Size&, VideoPixelFormat, VideoPixelStorage, int)); | 185 Buffer(const gfx::Size&, VideoPixelFormat, VideoPixelStorage, int)); |
186 MOCK_METHOD2(OnError, | 186 MOCK_METHOD2(OnError, |
187 void(const tracked_objects::Location& from_here, | 187 void(const tracked_objects::Location& from_here, |
188 const std::string& reason)); | 188 const std::string& reason)); |
189 MOCK_CONST_METHOD0(GetBufferPoolUtilization, double(void)); | 189 MOCK_CONST_METHOD0(GetBufferPoolUtilization, double(void)); |
| 190 MOCK_METHOD0(OnStarted, void(void)); |
190 }; | 191 }; |
191 | 192 |
192 class V4L2CaptureDelegateTest : public ::testing::Test { | 193 class V4L2CaptureDelegateTest : public ::testing::Test { |
193 public: | 194 public: |
194 V4L2CaptureDelegateTest() | 195 V4L2CaptureDelegateTest() |
195 : device_descriptor_("Device 0", "/dev/video0"), | 196 : device_descriptor_("Device 0", "/dev/video0"), |
196 delegate_(new V4L2CaptureDelegate(device_descriptor_, | 197 delegate_(new V4L2CaptureDelegate(device_descriptor_, |
197 base::ThreadTaskRunnerHandle::Get(), | 198 base::ThreadTaskRunnerHandle::Get(), |
198 50)) {} | 199 50)) {} |
199 ~V4L2CaptureDelegateTest() override = default; | 200 ~V4L2CaptureDelegateTest() override = default; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 // their |default_value|s. | 251 // their |default_value|s. |
251 { | 252 { |
252 base::ScopedFD device_fd( | 253 base::ScopedFD device_fd( |
253 HANDLE_EINTR(open(device_descriptor_.device_id.c_str(), O_RDWR))); | 254 HANDLE_EINTR(open(device_descriptor_.device_id.c_str(), O_RDWR))); |
254 ASSERT_TRUE(device_fd.is_valid()); | 255 ASSERT_TRUE(device_fd.is_valid()); |
255 VerifyUserControlsAreSetToDefaultValues(device_fd.get()); | 256 VerifyUserControlsAreSetToDefaultValues(device_fd.get()); |
256 } | 257 } |
257 } | 258 } |
258 | 259 |
259 }; // namespace media | 260 }; // namespace media |
OLD | NEW |