| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_to_current_loop.h" |
| 6 #include "base/callback.h" | 7 #include "base/callback.h" |
| 7 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 8 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 10 #include "content/child/child_process.h" | 11 #include "content/child/child_process.h" |
| 11 #include "content/renderer/media/video_capture_impl.h" | 12 #include "content/renderer/media/video_capture_impl.h" |
| 12 #include "content/renderer/media/video_capture_impl_manager.h" | 13 #include "content/renderer/media/video_capture_impl_manager.h" |
| 13 #include "content/renderer/media/video_capture_message_filter.h" | 14 #include "content/renderer/media/video_capture_message_filter.h" |
| 14 #include "media/base/bind_to_current_loop.h" | |
| 15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 using ::testing::_; | 18 using ::testing::_; |
| 19 using ::testing::DoAll; | 19 using ::testing::DoAll; |
| 20 using ::testing::SaveArg; | 20 using ::testing::SaveArg; |
| 21 using media::BindToCurrentLoop; | 21 using base::BindToCurrentLoop; |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 | 24 |
| 25 ACTION_P(RunClosure, closure) { | 25 ACTION_P(RunClosure, closure) { |
| 26 closure.Run(); | 26 closure.Run(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 class MockVideoCaptureImpl : public VideoCaptureImpl { | 29 class MockVideoCaptureImpl : public VideoCaptureImpl { |
| 30 public: | 30 public: |
| 31 MockVideoCaptureImpl(media::VideoCaptureSessionId session_id, | 31 MockVideoCaptureImpl(media::VideoCaptureSessionId session_id, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 cleanup_run_loop_.Run(); | 161 cleanup_run_loop_.Run(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 TEST_F(VideoCaptureImplManagerTest, NoLeak) { | 164 TEST_F(VideoCaptureImplManagerTest, NoLeak) { |
| 165 manager_->UseDevice(0).Reset(); | 165 manager_->UseDevice(0).Reset(); |
| 166 manager_.reset(); | 166 manager_.reset(); |
| 167 cleanup_run_loop_.Run(); | 167 cleanup_run_loop_.Run(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace content | 170 } // namespace content |
| OLD | NEW |