| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Unit test for VideoCaptureManager. | 5 // Unit test for VideoCaptureManager. |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // Needed as an input argument to StartCaptureForClient(). | 46 // Needed as an input argument to StartCaptureForClient(). |
| 47 class MockFrameObserver : public VideoCaptureControllerEventHandler { | 47 class MockFrameObserver : public VideoCaptureControllerEventHandler { |
| 48 public: | 48 public: |
| 49 MOCK_METHOD1(OnError, void(const VideoCaptureControllerID& id)); | 49 MOCK_METHOD1(OnError, void(const VideoCaptureControllerID& id)); |
| 50 | 50 |
| 51 virtual void OnBufferCreated(const VideoCaptureControllerID& id, | 51 virtual void OnBufferCreated(const VideoCaptureControllerID& id, |
| 52 base::SharedMemoryHandle handle, | 52 base::SharedMemoryHandle handle, |
| 53 int length, int buffer_id) OVERRIDE {} | 53 int length, int buffer_id) OVERRIDE {} |
| 54 virtual void OnBufferDestroyed(const VideoCaptureControllerID& id, | 54 virtual void OnBufferDestroyed(const VideoCaptureControllerID& id, |
| 55 int buffer_id) OVERRIDE {} | 55 int buffer_id) OVERRIDE {} |
| 56 virtual void OnBufferReady( | 56 virtual void OnBufferReady(const VideoCaptureControllerID& id, |
| 57 const VideoCaptureControllerID& id, | 57 int buffer_id, |
| 58 int buffer_id, | 58 base::TimeTicks timestamp, |
| 59 base::Time timestamp, | 59 const media::VideoCaptureFormat& format) |
| 60 const media::VideoCaptureFormat& format) OVERRIDE {} | 60 OVERRIDE {} |
| 61 virtual void OnEnded(const VideoCaptureControllerID& id) OVERRIDE {} | 61 virtual void OnEnded(const VideoCaptureControllerID& id) OVERRIDE {} |
| 62 | 62 |
| 63 void OnGotControllerCallback(VideoCaptureControllerID) {} | 63 void OnGotControllerCallback(VideoCaptureControllerID) {} |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 // Test class | 66 // Test class |
| 67 class VideoCaptureManagerTest : public testing::Test { | 67 class VideoCaptureManagerTest : public testing::Test { |
| 68 public: | 68 public: |
| 69 VideoCaptureManagerTest() : next_client_id_(1) {} | 69 VideoCaptureManagerTest() : next_client_id_(1) {} |
| 70 virtual ~VideoCaptureManagerTest() {} | 70 virtual ~VideoCaptureManagerTest() {} |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 // VideoCaptureManager destructor otherwise. | 382 // VideoCaptureManager destructor otherwise. |
| 383 vcm_->Close(video_session_id); | 383 vcm_->Close(video_session_id); |
| 384 StopClient(client_id); | 384 StopClient(client_id); |
| 385 | 385 |
| 386 // Wait to check callbacks before removing the listener | 386 // Wait to check callbacks before removing the listener |
| 387 message_loop_->RunUntilIdle(); | 387 message_loop_->RunUntilIdle(); |
| 388 vcm_->Unregister(); | 388 vcm_->Unregister(); |
| 389 } | 389 } |
| 390 | 390 |
| 391 } // namespace content | 391 } // namespace content |
| OLD | NEW |