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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 protected: | 202 protected: |
203 // mojom::VideoCaptureObserver implementation. | 203 // mojom::VideoCaptureObserver implementation. |
204 MOCK_METHOD1(OnStateChanged, void(mojom::VideoCaptureState)); | 204 MOCK_METHOD1(OnStateChanged, void(mojom::VideoCaptureState)); |
205 void OnBufferCreated(int32_t buffer_id, | 205 void OnBufferCreated(int32_t buffer_id, |
206 mojo::ScopedSharedBufferHandle handle) override { | 206 mojo::ScopedSharedBufferHandle handle) override { |
207 DoOnBufferCreated(buffer_id); | 207 DoOnBufferCreated(buffer_id); |
208 } | 208 } |
209 MOCK_METHOD1(DoOnBufferCreated, void(int32_t)); | 209 MOCK_METHOD1(DoOnBufferCreated, void(int32_t)); |
210 void OnBufferReady(int32_t buffer_id, | 210 void OnBufferReady(int32_t buffer_id, |
211 mojom::VideoFrameInfoPtr info) override { | 211 media::mojom::VideoFrameInfoPtr info) override { |
212 DoOnBufferReady(buffer_id); | 212 DoOnBufferReady(buffer_id); |
213 } | 213 } |
214 MOCK_METHOD1(DoOnBufferReady, void(int32_t)); | 214 MOCK_METHOD1(DoOnBufferReady, void(int32_t)); |
215 MOCK_METHOD1(OnBufferDestroyed, void(int32_t)); | 215 MOCK_METHOD1(OnBufferDestroyed, void(int32_t)); |
216 | 216 |
217 void StartCapture() { | 217 void StartCapture() { |
218 base::RunLoop run_loop; | 218 base::RunLoop run_loop; |
219 media::VideoCaptureParams params; | 219 media::VideoCaptureParams params; |
220 params.requested_format = media::VideoCaptureFormat( | 220 params.requested_format = media::VideoCaptureFormat( |
221 gfx::Size(352, 288), 30, media::PIXEL_FORMAT_I420); | 221 gfx::Size(352, 288), 30, media::PIXEL_FORMAT_I420); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 StartCapture(); | 358 StartCapture(); |
359 | 359 |
360 // When the session is closed via the stream without stopping capture, the | 360 // When the session is closed via the stream without stopping capture, the |
361 // ENDED event is sent. | 361 // ENDED event is sent. |
362 EXPECT_CALL(*this, OnStateChanged(mojom::VideoCaptureState::ENDED)); | 362 EXPECT_CALL(*this, OnStateChanged(mojom::VideoCaptureState::ENDED)); |
363 CloseSession(); | 363 CloseSession(); |
364 base::RunLoop().RunUntilIdle(); | 364 base::RunLoop().RunUntilIdle(); |
365 } | 365 } |
366 | 366 |
367 } // namespace content | 367 } // namespace content |
OLD | NEW |