| 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 VideoCaptureController. | 5 // Unit test for VideoCaptureController. |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/media/video_capture_controller.h" | 7 #include "content/browser/renderer_host/media/video_capture_controller.h" |
| 8 | 8 |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 : controller_(controller), resource_utilization_(-1.0) {} | 59 : controller_(controller), resource_utilization_(-1.0) {} |
| 60 ~MockVideoCaptureControllerEventHandler() override {} | 60 ~MockVideoCaptureControllerEventHandler() override {} |
| 61 | 61 |
| 62 // These mock methods are delegated to by our fake implementation of | 62 // These mock methods are delegated to by our fake implementation of |
| 63 // VideoCaptureControllerEventHandler, to be used in EXPECT_CALL(). | 63 // VideoCaptureControllerEventHandler, to be used in EXPECT_CALL(). |
| 64 MOCK_METHOD1(DoBufferCreated, void(VideoCaptureControllerID)); | 64 MOCK_METHOD1(DoBufferCreated, void(VideoCaptureControllerID)); |
| 65 MOCK_METHOD1(DoBufferDestroyed, void(VideoCaptureControllerID)); | 65 MOCK_METHOD1(DoBufferDestroyed, void(VideoCaptureControllerID)); |
| 66 MOCK_METHOD2(DoBufferReady, void(VideoCaptureControllerID, const gfx::Size&)); | 66 MOCK_METHOD2(DoBufferReady, void(VideoCaptureControllerID, const gfx::Size&)); |
| 67 MOCK_METHOD1(DoEnded, void(VideoCaptureControllerID)); | 67 MOCK_METHOD1(DoEnded, void(VideoCaptureControllerID)); |
| 68 MOCK_METHOD1(DoError, void(VideoCaptureControllerID)); | 68 MOCK_METHOD1(DoError, void(VideoCaptureControllerID)); |
| 69 MOCK_METHOD1(OnStarted, void(VideoCaptureControllerID)); |
| 69 | 70 |
| 70 void OnError(VideoCaptureControllerID id) override { DoError(id); } | 71 void OnError(VideoCaptureControllerID id) override { DoError(id); } |
| 71 void OnBufferCreated(VideoCaptureControllerID id, | 72 void OnBufferCreated(VideoCaptureControllerID id, |
| 72 mojo::ScopedSharedBufferHandle handle, | 73 mojo::ScopedSharedBufferHandle handle, |
| 73 int length, | 74 int length, |
| 74 int buffer_id) override { | 75 int buffer_id) override { |
| 75 DoBufferCreated(id); | 76 DoBufferCreated(id); |
| 76 } | 77 } |
| 77 void OnBufferDestroyed(VideoCaptureControllerID id, int buffer_id) override { | 78 void OnBufferDestroyed(VideoCaptureControllerID id, int buffer_id) override { |
| 78 DoBufferDestroyed(id); | 79 DoBufferDestroyed(id); |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 std::move(buffer), arbitrary_format, arbitrary_reference_time_, | 646 std::move(buffer), arbitrary_format, arbitrary_reference_time_, |
| 646 arbitrary_timestamp_); | 647 arbitrary_timestamp_); |
| 647 | 648 |
| 648 base::RunLoop().RunUntilIdle(); | 649 base::RunLoop().RunUntilIdle(); |
| 649 Mock::VerifyAndClearExpectations(client_a_.get()); | 650 Mock::VerifyAndClearExpectations(client_a_.get()); |
| 650 Mock::VerifyAndClearExpectations(mock_consumer_feedback_observer_); | 651 Mock::VerifyAndClearExpectations(mock_consumer_feedback_observer_); |
| 651 } | 652 } |
| 652 } | 653 } |
| 653 | 654 |
| 654 } // namespace content | 655 } // namespace content |
| OLD | NEW |