| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <array> | 5 #include <array> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 filter, | 57 filter, |
| 58 ChildProcess::current()->io_task_runner()), | 58 ChildProcess::current()->io_task_runner()), |
| 59 pause_callback_(pause_callback), | 59 pause_callback_(pause_callback), |
| 60 destruct_callback_(destruct_callback) {} | 60 destruct_callback_(destruct_callback) {} |
| 61 | 61 |
| 62 ~MockVideoCaptureImpl() override { destruct_callback_.Run(); } | 62 ~MockVideoCaptureImpl() override { destruct_callback_.Run(); } |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 void Start(int32_t device_id, | 65 void Start(int32_t device_id, |
| 66 int32_t session_id, | 66 int32_t session_id, |
| 67 const media::VideoCaptureParams& params) override { | 67 const media::VideoCaptureParams& params, |
| 68 mojom::VideoCaptureObserverPtr observer) override { |
| 68 // For every Start(), expect a corresponding Stop() call. | 69 // For every Start(), expect a corresponding Stop() call. |
| 69 EXPECT_CALL(*this, Stop(_)); | 70 EXPECT_CALL(*this, Stop(_)); |
| 70 } | 71 } |
| 71 | 72 |
| 72 MOCK_METHOD1(Stop, void(int32_t)); | 73 MOCK_METHOD1(Stop, void(int32_t)); |
| 73 | 74 |
| 74 void Pause(int device_id) { pause_callback_->OnPaused(session_id()); } | 75 void Pause(int device_id) { pause_callback_->OnPaused(session_id()); } |
| 75 | 76 |
| 76 void Resume(int32_t device_id, | 77 void Resume(int32_t device_id, |
| 77 int32_t session_id, | 78 int32_t session_id, |
| 78 const media::VideoCaptureParams& params) override { | 79 const media::VideoCaptureParams& params) override { |
| 79 pause_callback_->OnResumed(session_id); | 80 pause_callback_->OnResumed(session_id); |
| 80 } | 81 } |
| 81 | 82 |
| 82 MOCK_METHOD1(RequestRefreshFrame, void(int32_t)); | 83 MOCK_METHOD1(RequestRefreshFrame, void(int32_t)); |
| 84 MOCK_METHOD4(ReleaseBuffer, |
| 85 void(int32_t, int32_t, const gpu::SyncToken&, double)); |
| 83 MOCK_METHOD3(GetDeviceSupportedFormats, | 86 MOCK_METHOD3(GetDeviceSupportedFormats, |
| 84 void(int32_t, | 87 void(int32_t, |
| 85 int32_t, | 88 int32_t, |
| 86 const GetDeviceSupportedFormatsCallback&)); | 89 const GetDeviceSupportedFormatsCallback&)); |
| 87 MOCK_METHOD3(GetDeviceFormatsInUse, | 90 MOCK_METHOD3(GetDeviceFormatsInUse, |
| 88 void(int32_t, int32_t, const GetDeviceFormatsInUseCallback&)); | 91 void(int32_t, int32_t, const GetDeviceFormatsInUseCallback&)); |
| 89 | 92 |
| 90 PauseResumeCallback* const pause_callback_; | 93 PauseResumeCallback* const pause_callback_; |
| 91 const base::Closure destruct_callback_; | 94 const base::Closure destruct_callback_; |
| 92 | 95 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 run_loop.Run(); | 304 run_loop.Run(); |
| 302 } | 305 } |
| 303 | 306 |
| 304 StopCaptureForAllClients(&stop_callbacks); | 307 StopCaptureForAllClients(&stop_callbacks); |
| 305 for (const auto& release_callback : release_callbacks) | 308 for (const auto& release_callback : release_callbacks) |
| 306 release_callback.Run(); | 309 release_callback.Run(); |
| 307 cleanup_run_loop_.Run(); | 310 cleanup_run_loop_.Run(); |
| 308 } | 311 } |
| 309 | 312 |
| 310 } // namespace content | 313 } // namespace content |
| OLD | NEW |