| 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 const media::VideoCaptureFormat& format, |
| 59 base::TimeTicks timestamp, | 59 base::TimeTicks timestamp) OVERRIDE {} |
| 60 const media::VideoCaptureFormat& format) OVERRIDE {} | 60 virtual void OnMailboxBufferReady(const VideoCaptureControllerID& id, |
| 61 int buffer_id, |
| 62 const gpu::MailboxHolder& mailbox_holder, |
| 63 const media::VideoCaptureFormat& format, |
| 64 base::TimeTicks timestamp) OVERRIDE {} |
| 61 virtual void OnEnded(const VideoCaptureControllerID& id) OVERRIDE {} | 65 virtual void OnEnded(const VideoCaptureControllerID& id) OVERRIDE {} |
| 62 | 66 |
| 63 void OnGotControllerCallback(VideoCaptureControllerID) {} | 67 void OnGotControllerCallback(VideoCaptureControllerID) {} |
| 64 }; | 68 }; |
| 65 | 69 |
| 66 // Test class | 70 // Test class |
| 67 class VideoCaptureManagerTest : public testing::Test { | 71 class VideoCaptureManagerTest : public testing::Test { |
| 68 public: | 72 public: |
| 69 VideoCaptureManagerTest() : next_client_id_(1) {} | 73 VideoCaptureManagerTest() : next_client_id_(1) {} |
| 70 virtual ~VideoCaptureManagerTest() {} | 74 virtual ~VideoCaptureManagerTest() {} |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 // VideoCaptureManager destructor otherwise. | 446 // VideoCaptureManager destructor otherwise. |
| 443 vcm_->Close(video_session_id); | 447 vcm_->Close(video_session_id); |
| 444 StopClient(client_id); | 448 StopClient(client_id); |
| 445 | 449 |
| 446 // Wait to check callbacks before removing the listener | 450 // Wait to check callbacks before removing the listener |
| 447 message_loop_->RunUntilIdle(); | 451 message_loop_->RunUntilIdle(); |
| 448 vcm_->Unregister(); | 452 vcm_->Unregister(); |
| 449 } | 453 } |
| 450 | 454 |
| 451 } // namespace content | 455 } // namespace content |
| OLD | NEW |