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/renderer_host/media/desktop_capture_device_aura.h" | 5 #include "content/browser/renderer_host/media/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/video/capture/video_capture_types.h" | 10 #include "media/video/capture/video_capture_types.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Test harness that sets up a minimal environment with necessary stubs. | 50 // Test harness that sets up a minimal environment with necessary stubs. |
51 class DesktopCaptureDeviceAuraTest : public testing::Test { | 51 class DesktopCaptureDeviceAuraTest : public testing::Test { |
52 public: | 52 public: |
53 DesktopCaptureDeviceAuraTest() | 53 DesktopCaptureDeviceAuraTest() |
54 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} | 54 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} |
55 virtual ~DesktopCaptureDeviceAuraTest() {} | 55 virtual ~DesktopCaptureDeviceAuraTest() {} |
56 | 56 |
57 protected: | 57 protected: |
58 virtual void SetUp() OVERRIDE { | 58 virtual void SetUp() OVERRIDE { |
59 helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); | 59 helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
60 helper_->SetUp(); | 60 bool allow_test_contexts = true; |
| 61 helper_->SetUp(allow_test_contexts); |
61 | 62 |
62 // We need a window to cover desktop area so that DesktopCaptureDeviceAura | 63 // We need a window to cover desktop area so that DesktopCaptureDeviceAura |
63 // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the | 64 // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the |
64 // root window associated with the primary display. | 65 // root window associated with the primary display. |
65 gfx::Rect desktop_bounds = root_window()->bounds(); | 66 gfx::Rect desktop_bounds = root_window()->bounds(); |
66 window_delegate_.reset(new aura::test::TestWindowDelegate()); | 67 window_delegate_.reset(new aura::test::TestWindowDelegate()); |
67 desktop_window_.reset(new aura::Window(window_delegate_.get())); | 68 desktop_window_.reset(new aura::Window(window_delegate_.get())); |
68 desktop_window_->Init(ui::LAYER_TEXTURED); | 69 desktop_window_->Init(ui::LAYER_TEXTURED); |
69 desktop_window_->SetBounds(desktop_bounds); | 70 desktop_window_->SetBounds(desktop_bounds); |
70 aura::client::ParentWindowWithContext( | 71 aura::client::ParentWindowWithContext( |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 capture_params.requested_format.frame_rate = kFrameRate; | 106 capture_params.requested_format.frame_rate = kFrameRate; |
106 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; | 107 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; |
107 capture_params.allow_resolution_change = false; | 108 capture_params.allow_resolution_change = false; |
108 capture_device->AllocateAndStart( | 109 capture_device->AllocateAndStart( |
109 capture_params, client.PassAs<media::VideoCaptureDevice::Client>()); | 110 capture_params, client.PassAs<media::VideoCaptureDevice::Client>()); |
110 capture_device->StopAndDeAllocate(); | 111 capture_device->StopAndDeAllocate(); |
111 } | 112 } |
112 | 113 |
113 } // namespace | 114 } // namespace |
114 } // namespace content | 115 } // namespace content |
OLD | NEW |