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