| 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/video/capture/video_capture_types.h" | 10 #include "media/video/capture/video_capture_types.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 class DesktopCaptureDeviceAuraTest : public testing::Test { | 56 class DesktopCaptureDeviceAuraTest : public testing::Test { |
| 57 public: | 57 public: |
| 58 DesktopCaptureDeviceAuraTest() | 58 DesktopCaptureDeviceAuraTest() |
| 59 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} | 59 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} |
| 60 virtual ~DesktopCaptureDeviceAuraTest() {} | 60 virtual ~DesktopCaptureDeviceAuraTest() {} |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 virtual void SetUp() OVERRIDE { | 63 virtual void SetUp() OVERRIDE { |
| 64 // The ContextFactory must exist before any Compositors are created. | 64 // The ContextFactory must exist before any Compositors are created. |
| 65 bool enable_pixel_output = false; | 65 bool enable_pixel_output = false; |
| 66 ui::InitializeContextFactoryForTests(enable_pixel_output); | 66 ui::ContextFactory* context_factory = |
| 67 ui::InitializeContextFactoryForTests(enable_pixel_output); |
| 67 helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); | 68 helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
| 68 helper_->SetUp(); | 69 helper_->SetUp(context_factory); |
| 69 new wm::DefaultActivationClient(helper_->root_window()); | 70 new wm::DefaultActivationClient(helper_->root_window()); |
| 70 | 71 |
| 71 // We need a window to cover desktop area so that DesktopCaptureDeviceAura | 72 // We need a window to cover desktop area so that DesktopCaptureDeviceAura |
| 72 // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the | 73 // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the |
| 73 // root window associated with the primary display. | 74 // root window associated with the primary display. |
| 74 gfx::Rect desktop_bounds = root_window()->bounds(); | 75 gfx::Rect desktop_bounds = root_window()->bounds(); |
| 75 window_delegate_.reset(new aura::test::TestWindowDelegate()); | 76 window_delegate_.reset(new aura::test::TestWindowDelegate()); |
| 76 desktop_window_.reset(new aura::Window(window_delegate_.get())); | 77 desktop_window_.reset(new aura::Window(window_delegate_.get())); |
| 77 desktop_window_->Init(aura::WINDOW_LAYER_TEXTURED); | 78 desktop_window_->Init(aura::WINDOW_LAYER_TEXTURED); |
| 78 desktop_window_->SetBounds(desktop_bounds); | 79 desktop_window_->SetBounds(desktop_bounds); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 capture_params.requested_format.frame_rate = kFrameRate; | 116 capture_params.requested_format.frame_rate = kFrameRate; |
| 116 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; | 117 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; |
| 117 capture_params.allow_resolution_change = false; | 118 capture_params.allow_resolution_change = false; |
| 118 capture_device->AllocateAndStart( | 119 capture_device->AllocateAndStart( |
| 119 capture_params, client.PassAs<media::VideoCaptureDevice::Client>()); | 120 capture_params, client.PassAs<media::VideoCaptureDevice::Client>()); |
| 120 capture_device->StopAndDeAllocate(); | 121 capture_device->StopAndDeAllocate(); |
| 121 } | 122 } |
| 122 | 123 |
| 123 } // namespace | 124 } // namespace |
| 124 } // namespace content | 125 } // namespace content |
| OLD | NEW |