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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 FROM_HERE, | 84 FROM_HERE, |
85 base::Bind( | 85 base::Bind( |
86 &VideoCaptureImplManagerTest::FakeChannelSetup, | 86 &VideoCaptureImplManagerTest::FakeChannelSetup, |
87 base::Unretained(this))); | 87 base::Unretained(this))); |
88 return; | 88 return; |
89 } | 89 } |
90 manager_->video_capture_message_filter()->OnFilterAdded(NULL); | 90 manager_->video_capture_message_filter()->OnFilterAdded(NULL); |
91 } | 91 } |
92 | 92 |
93 protected: | 93 protected: |
94 MOCK_METHOD3(OnFrameReady, | 94 MOCK_METHOD2(OnFrameReady, |
95 void(const scoped_refptr<media::VideoFrame>&, | 95 void(const scoped_refptr<media::VideoFrame>&, |
96 const media::VideoCaptureFormat&, | |
97 const base::TimeTicks& estimated_capture_time)); | 96 const base::TimeTicks& estimated_capture_time)); |
98 MOCK_METHOD0(OnStarted, void()); | 97 MOCK_METHOD0(OnStarted, void()); |
99 MOCK_METHOD0(OnStopped, void()); | 98 MOCK_METHOD0(OnStopped, void()); |
100 | 99 |
101 void OnStateUpdate(VideoCaptureState state) { | 100 void OnStateUpdate(VideoCaptureState state) { |
102 switch (state) { | 101 switch (state) { |
103 case VIDEO_CAPTURE_STATE_STARTED: | 102 case VIDEO_CAPTURE_STATE_STARTED: |
104 OnStarted(); | 103 OnStarted(); |
105 break; | 104 break; |
106 case VIDEO_CAPTURE_STATE_STOPPED: | 105 case VIDEO_CAPTURE_STATE_STOPPED: |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 cleanup_run_loop_.Run(); | 165 cleanup_run_loop_.Run(); |
167 } | 166 } |
168 | 167 |
169 TEST_F(VideoCaptureImplManagerTest, NoLeak) { | 168 TEST_F(VideoCaptureImplManagerTest, NoLeak) { |
170 manager_->UseDevice(0).Reset(); | 169 manager_->UseDevice(0).Reset(); |
171 manager_.reset(); | 170 manager_.reset(); |
172 cleanup_run_loop_.Run(); | 171 cleanup_run_loop_.Run(); |
173 } | 172 } |
174 | 173 |
175 } // namespace content | 174 } // namespace content |
OLD | NEW |