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 #include "content/browser/renderer_host/media/video_capture_controller.h" | 5 #include "content/browser/renderer_host/media/video_capture_controller.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 // These mock methods are delegated to by our fake implementation of | 63 // These mock methods are delegated to by our fake implementation of |
64 // VideoCaptureControllerEventHandler, to be used in EXPECT_CALL(). | 64 // VideoCaptureControllerEventHandler, to be used in EXPECT_CALL(). |
65 MOCK_METHOD2(DoBufferCreated, void(VideoCaptureControllerID, int buffer_id)); | 65 MOCK_METHOD2(DoBufferCreated, void(VideoCaptureControllerID, int buffer_id)); |
66 MOCK_METHOD2(DoBufferDestroyed, | 66 MOCK_METHOD2(DoBufferDestroyed, |
67 void(VideoCaptureControllerID, int buffer_id)); | 67 void(VideoCaptureControllerID, int buffer_id)); |
68 MOCK_METHOD2(DoBufferReady, void(VideoCaptureControllerID, const gfx::Size&)); | 68 MOCK_METHOD2(DoBufferReady, void(VideoCaptureControllerID, const gfx::Size&)); |
69 MOCK_METHOD1(DoEnded, void(VideoCaptureControllerID)); | 69 MOCK_METHOD1(DoEnded, void(VideoCaptureControllerID)); |
70 MOCK_METHOD1(DoError, void(VideoCaptureControllerID)); | 70 MOCK_METHOD1(DoError, void(VideoCaptureControllerID)); |
| 71 MOCK_METHOD1(OnStarted, void(VideoCaptureControllerID)); |
71 | 72 |
72 void OnError(VideoCaptureControllerID id) override { DoError(id); } | 73 void OnError(VideoCaptureControllerID id) override { DoError(id); } |
73 void OnBufferCreated(VideoCaptureControllerID id, | 74 void OnBufferCreated(VideoCaptureControllerID id, |
74 mojo::ScopedSharedBufferHandle handle, | 75 mojo::ScopedSharedBufferHandle handle, |
75 int length, | 76 int length, |
76 int buffer_id) override { | 77 int buffer_id) override { |
77 DoBufferCreated(id, buffer_id); | 78 DoBufferCreated(id, buffer_id); |
78 } | 79 } |
79 void OnBufferDestroyed(VideoCaptureControllerID id, int buffer_id) override { | 80 void OnBufferDestroyed(VideoCaptureControllerID id, int buffer_id) override { |
80 DoBufferDestroyed(id, buffer_id); | 81 DoBufferDestroyed(id, buffer_id); |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 // buffer is expected to stay alive. | 797 // buffer is expected to stay alive. |
797 EXPECT_CALL(*client_a_, DoBufferDestroyed(_, first_buffer_id)).Times(0); | 798 EXPECT_CALL(*client_a_, DoBufferDestroyed(_, first_buffer_id)).Times(0); |
798 EXPECT_CALL(*client_a_, DoBufferDestroyed(_, second_buffer_id)).Times(0); | 799 EXPECT_CALL(*client_a_, DoBufferDestroyed(_, second_buffer_id)).Times(0); |
799 controller_->ReturnBuffer(arbitrary_route_id_, client_a_.get(), | 800 controller_->ReturnBuffer(arbitrary_route_id_, client_a_.get(), |
800 second_buffer_id, arbitrary_utilization); | 801 second_buffer_id, arbitrary_utilization); |
801 base::RunLoop().RunUntilIdle(); | 802 base::RunLoop().RunUntilIdle(); |
802 Mock::VerifyAndClearExpectations(client_a_.get()); | 803 Mock::VerifyAndClearExpectations(client_a_.get()); |
803 } | 804 } |
804 | 805 |
805 } // namespace content | 806 } // namespace content |
OLD | NEW |