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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 // buffer is expected to stay alive. | 835 // buffer is expected to stay alive. |
835 EXPECT_CALL(*client_a_, DoBufferDestroyed(_, first_buffer_id)).Times(0); | 836 EXPECT_CALL(*client_a_, DoBufferDestroyed(_, first_buffer_id)).Times(0); |
836 EXPECT_CALL(*client_a_, DoBufferDestroyed(_, second_buffer_id)).Times(0); | 837 EXPECT_CALL(*client_a_, DoBufferDestroyed(_, second_buffer_id)).Times(0); |
837 controller_->ReturnBuffer(arbitrary_route_id_, client_a_.get(), | 838 controller_->ReturnBuffer(arbitrary_route_id_, client_a_.get(), |
838 second_buffer_id, arbitrary_utilization); | 839 second_buffer_id, arbitrary_utilization); |
839 base::RunLoop().RunUntilIdle(); | 840 base::RunLoop().RunUntilIdle(); |
840 Mock::VerifyAndClearExpectations(client_a_.get()); | 841 Mock::VerifyAndClearExpectations(client_a_.get()); |
841 } | 842 } |
842 | 843 |
843 } // namespace content | 844 } // namespace content |
OLD | NEW |