| 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 "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
| 8 #include "content/browser/browser_thread_impl.h" | 8 #include "content/browser/browser_thread_impl.h" |
| 9 #include "content/public/browser/desktop_media_id.h" | 9 #include "content/public/browser/desktop_media_id.h" |
| 10 #include "media/base/video_capture_types.h" | 10 #include "media/base/video_capture_types.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 public: | 37 public: |
| 38 MOCK_METHOD5(OnIncomingCapturedData, | 38 MOCK_METHOD5(OnIncomingCapturedData, |
| 39 void(const uint8* data, | 39 void(const uint8* data, |
| 40 int length, | 40 int length, |
| 41 const media::VideoCaptureFormat& frame_format, | 41 const media::VideoCaptureFormat& frame_format, |
| 42 int rotation, | 42 int rotation, |
| 43 const base::TimeTicks& timestamp)); | 43 const base::TimeTicks& timestamp)); |
| 44 MOCK_METHOD2(ReserveOutputBuffer, | 44 MOCK_METHOD2(ReserveOutputBuffer, |
| 45 scoped_refptr<Buffer>(media::VideoFrame::Format format, | 45 scoped_refptr<Buffer>(media::VideoFrame::Format format, |
| 46 const gfx::Size& dimensions)); | 46 const gfx::Size& dimensions)); |
| 47 MOCK_METHOD4(OnIncomingCapturedVideoFrame, | 47 MOCK_METHOD3(OnIncomingCapturedVideoFrame, |
| 48 void(const scoped_refptr<Buffer>& buffer, | 48 void(const scoped_refptr<Buffer>& buffer, |
| 49 const media::VideoCaptureFormat& buffer_format, | |
| 50 const scoped_refptr<media::VideoFrame>& frame, | 49 const scoped_refptr<media::VideoFrame>& frame, |
| 51 const base::TimeTicks& timestamp)); | 50 const base::TimeTicks& timestamp)); |
| 52 MOCK_METHOD1(OnError, void(const std::string& reason)); | 51 MOCK_METHOD1(OnError, void(const std::string& reason)); |
| 53 }; | 52 }; |
| 54 | 53 |
| 55 // Test harness that sets up a minimal environment with necessary stubs. | 54 // Test harness that sets up a minimal environment with necessary stubs. |
| 56 class DesktopCaptureDeviceAuraTest : public testing::Test { | 55 class DesktopCaptureDeviceAuraTest : public testing::Test { |
| 57 public: | 56 public: |
| 58 DesktopCaptureDeviceAuraTest() | 57 DesktopCaptureDeviceAuraTest() |
| 59 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} | 58 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 media::VideoCaptureParams capture_params; | 113 media::VideoCaptureParams capture_params; |
| 115 capture_params.requested_format.frame_size.SetSize(640, 480); | 114 capture_params.requested_format.frame_size.SetSize(640, 480); |
| 116 capture_params.requested_format.frame_rate = kFrameRate; | 115 capture_params.requested_format.frame_rate = kFrameRate; |
| 117 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; | 116 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; |
| 118 capture_device->AllocateAndStart(capture_params, client.Pass()); | 117 capture_device->AllocateAndStart(capture_params, client.Pass()); |
| 119 capture_device->StopAndDeAllocate(); | 118 capture_device->StopAndDeAllocate(); |
| 120 } | 119 } |
| 121 | 120 |
| 122 } // namespace | 121 } // namespace |
| 123 } // namespace content | 122 } // namespace content |
| OLD | NEW |