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 21 matching lines...) Expand all Loading... |
32 // Listener class used to track progress of VideoCaptureManager test. | 32 // Listener class used to track progress of VideoCaptureManager test. |
33 class MockMediaStreamProviderListener : public MediaStreamProviderListener { | 33 class MockMediaStreamProviderListener : public MediaStreamProviderListener { |
34 public: | 34 public: |
35 MockMediaStreamProviderListener() {} | 35 MockMediaStreamProviderListener() {} |
36 ~MockMediaStreamProviderListener() {} | 36 ~MockMediaStreamProviderListener() {} |
37 | 37 |
38 MOCK_METHOD2(Opened, void(MediaStreamType, int)); | 38 MOCK_METHOD2(Opened, void(MediaStreamType, int)); |
39 MOCK_METHOD2(Closed, void(MediaStreamType, int)); | 39 MOCK_METHOD2(Closed, void(MediaStreamType, int)); |
40 MOCK_METHOD2(DevicesEnumerated, void(MediaStreamType, | 40 MOCK_METHOD2(DevicesEnumerated, void(MediaStreamType, |
41 const StreamDeviceInfoArray&)); | 41 const StreamDeviceInfoArray&)); |
42 MOCK_METHOD3(Error, void(MediaStreamType, int, | 42 MOCK_METHOD2(Aborted, void(MediaStreamType, int)); |
43 MediaStreamProviderError)); | |
44 }; // class MockMediaStreamProviderListener | 43 }; // class MockMediaStreamProviderListener |
45 | 44 |
46 // Needed as an input argument to StartCaptureForClient(). | 45 // Needed as an input argument to StartCaptureForClient(). |
47 class MockFrameObserver : public VideoCaptureControllerEventHandler { | 46 class MockFrameObserver : public VideoCaptureControllerEventHandler { |
48 public: | 47 public: |
49 MOCK_METHOD1(OnError, void(const VideoCaptureControllerID& id)); | 48 MOCK_METHOD1(OnError, void(const VideoCaptureControllerID& id)); |
50 | 49 |
51 virtual void OnBufferCreated(const VideoCaptureControllerID& id, | 50 virtual void OnBufferCreated(const VideoCaptureControllerID& id, |
52 base::SharedMemoryHandle handle, | 51 base::SharedMemoryHandle handle, |
53 int length, int buffer_id) OVERRIDE {} | 52 int length, int buffer_id) OVERRIDE {} |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 448 |
450 // Wait to check callbacks before removing the listener | 449 // Wait to check callbacks before removing the listener |
451 message_loop_->RunUntilIdle(); | 450 message_loop_->RunUntilIdle(); |
452 vcm_->Unregister(); | 451 vcm_->Unregister(); |
453 } | 452 } |
454 | 453 |
455 // TODO(mcasas): Add a test to check consolidation of the supported formats | 454 // TODO(mcasas): Add a test to check consolidation of the supported formats |
456 // provided by the device when http://crbug.com/323913 is closed. | 455 // provided by the device when http://crbug.com/323913 is closed. |
457 | 456 |
458 } // namespace content | 457 } // namespace content |
OLD | NEW |