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/callback.h" | 6 #include "base/callback.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "content/child/child_process.h" | 10 #include "content/child/child_process.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 public: | 49 public: |
50 explicit MockVideoCaptureImplManager( | 50 explicit MockVideoCaptureImplManager( |
51 base::Closure destruct_video_capture_callback) | 51 base::Closure destruct_video_capture_callback) |
52 : destruct_video_capture_callback_( | 52 : destruct_video_capture_callback_( |
53 destruct_video_capture_callback) {} | 53 destruct_video_capture_callback) {} |
54 virtual ~MockVideoCaptureImplManager() {} | 54 virtual ~MockVideoCaptureImplManager() {} |
55 | 55 |
56 protected: | 56 protected: |
57 virtual VideoCaptureImpl* CreateVideoCaptureImplForTesting( | 57 virtual VideoCaptureImpl* CreateVideoCaptureImplForTesting( |
58 media::VideoCaptureSessionId id, | 58 media::VideoCaptureSessionId id, |
59 VideoCaptureMessageFilter* filter) const OVERRIDE { | 59 VideoCaptureMessageFilter* filter) const override { |
60 return new MockVideoCaptureImpl(id, | 60 return new MockVideoCaptureImpl(id, |
61 filter, | 61 filter, |
62 destruct_video_capture_callback_); | 62 destruct_video_capture_callback_); |
63 } | 63 } |
64 | 64 |
65 private: | 65 private: |
66 base::Closure destruct_video_capture_callback_; | 66 base::Closure destruct_video_capture_callback_; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(MockVideoCaptureImplManager); | 68 DISALLOW_COPY_AND_ASSIGN(MockVideoCaptureImplManager); |
69 }; | 69 }; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 cleanup_run_loop_.Run(); | 168 cleanup_run_loop_.Run(); |
169 } | 169 } |
170 | 170 |
171 TEST_F(VideoCaptureImplManagerTest, NoLeak) { | 171 TEST_F(VideoCaptureImplManagerTest, NoLeak) { |
172 manager_->UseDevice(0).Reset(); | 172 manager_->UseDevice(0).Reset(); |
173 manager_.reset(); | 173 manager_.reset(); |
174 cleanup_run_loop_.Run(); | 174 cleanup_run_loop_.Run(); |
175 } | 175 } |
176 | 176 |
177 } // namespace content | 177 } // namespace content |
OLD | NEW |