| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/media/capture/desktop_capture_device_aura.h" | 5 #include "content/browser/media/capture/desktop_capture_device_aura.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 base::TimeTicks reference_time, | 49 base::TimeTicks reference_time, |
| 50 base::TimeDelta tiemstamp, | 50 base::TimeDelta tiemstamp, |
| 51 int frame_feedback_id)); | 51 int frame_feedback_id)); |
| 52 MOCK_METHOD0(DoReserveOutputBuffer, void(void)); | 52 MOCK_METHOD0(DoReserveOutputBuffer, void(void)); |
| 53 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); | 53 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); |
| 54 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); | 54 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); |
| 55 MOCK_METHOD0(DoResurrectLastOutputBuffer, void(void)); | 55 MOCK_METHOD0(DoResurrectLastOutputBuffer, void(void)); |
| 56 MOCK_METHOD2(OnError, | 56 MOCK_METHOD2(OnError, |
| 57 void(const tracked_objects::Location& from_here, | 57 void(const tracked_objects::Location& from_here, |
| 58 const std::string& reason)); | 58 const std::string& reason)); |
| 59 MOCK_METHOD0(OnStarted, void(void)); |
| 59 | 60 |
| 60 // Trampoline methods to workaround GMOCK problems with std::unique_ptr<>. | 61 // Trampoline methods to workaround GMOCK problems with std::unique_ptr<>. |
| 61 Buffer ReserveOutputBuffer(const gfx::Size& dimensions, | 62 Buffer ReserveOutputBuffer(const gfx::Size& dimensions, |
| 62 media::VideoPixelFormat format, | 63 media::VideoPixelFormat format, |
| 63 media::VideoPixelStorage storage, | 64 media::VideoPixelStorage storage, |
| 64 int frame_feedback_id) override { | 65 int frame_feedback_id) override { |
| 65 EXPECT_EQ(media::PIXEL_FORMAT_I420, format); | 66 EXPECT_EQ(media::PIXEL_FORMAT_I420, format); |
| 66 EXPECT_EQ(media::PIXEL_STORAGE_CPU, storage); | 67 EXPECT_EQ(media::PIXEL_STORAGE_CPU, storage); |
| 67 DoReserveOutputBuffer(); | 68 DoReserveOutputBuffer(); |
| 68 return Buffer(); | 69 return Buffer(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 149 |
| 149 TEST_F(DesktopCaptureDeviceAuraTest, StartAndStop) { | 150 TEST_F(DesktopCaptureDeviceAuraTest, StartAndStop) { |
| 150 std::unique_ptr<media::VideoCaptureDevice> capture_device = | 151 std::unique_ptr<media::VideoCaptureDevice> capture_device = |
| 151 DesktopCaptureDeviceAura::Create( | 152 DesktopCaptureDeviceAura::Create( |
| 152 content::DesktopMediaID::RegisterAuraWindow( | 153 content::DesktopMediaID::RegisterAuraWindow( |
| 153 content::DesktopMediaID::TYPE_SCREEN, root_window())); | 154 content::DesktopMediaID::TYPE_SCREEN, root_window())); |
| 154 ASSERT_TRUE(capture_device); | 155 ASSERT_TRUE(capture_device); |
| 155 | 156 |
| 156 std::unique_ptr<MockDeviceClient> client(new MockDeviceClient()); | 157 std::unique_ptr<MockDeviceClient> client(new MockDeviceClient()); |
| 157 EXPECT_CALL(*client, OnError(_, _)).Times(0); | 158 EXPECT_CALL(*client, OnError(_, _)).Times(0); |
| 159 EXPECT_CALL(*client, OnStarted()); |
| 158 | 160 |
| 159 media::VideoCaptureParams capture_params; | 161 media::VideoCaptureParams capture_params; |
| 160 capture_params.requested_format.frame_size.SetSize(640, 480); | 162 capture_params.requested_format.frame_size.SetSize(640, 480); |
| 161 capture_params.requested_format.frame_rate = kFrameRate; | 163 capture_params.requested_format.frame_rate = kFrameRate; |
| 162 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; | 164 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; |
| 163 capture_device->AllocateAndStart(capture_params, std::move(client)); | 165 capture_device->AllocateAndStart(capture_params, std::move(client)); |
| 164 capture_device->StopAndDeAllocate(); | 166 capture_device->StopAndDeAllocate(); |
| 165 } | 167 } |
| 166 | 168 |
| 167 } // namespace | 169 } // namespace |
| 168 } // namespace content | 170 } // namespace content |
| OLD | NEW |