Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: content/browser/media/capture/desktop_capture_device_aura_unittest.cc

Issue 261553002: Revert of Move DefaultActivationClient to wm/core (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/DEPS ('k') | content/browser/renderer_host/render_widget_host_view_aura_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "testing/gmock/include/gmock/gmock.h" 11 #include "testing/gmock/include/gmock/gmock.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "ui/aura/client/window_tree_client.h" 13 #include "ui/aura/client/window_tree_client.h"
14 #include "ui/aura/test/aura_test_helper.h" 14 #include "ui/aura/test/aura_test_helper.h"
15 #include "ui/aura/test/test_window_delegate.h" 15 #include "ui/aura/test/test_window_delegate.h"
16 #include "ui/aura/window.h" 16 #include "ui/aura/window.h"
17 #include "ui/compositor/test/context_factories_for_test.h" 17 #include "ui/compositor/test/context_factories_for_test.h"
18 #include "ui/wm/core/default_activation_client.h"
19 18
20 using ::testing::_; 19 using ::testing::_;
21 using ::testing::AnyNumber; 20 using ::testing::AnyNumber;
22 using ::testing::DoAll; 21 using ::testing::DoAll;
23 using ::testing::Expectation; 22 using ::testing::Expectation;
24 using ::testing::InvokeWithoutArgs; 23 using ::testing::InvokeWithoutArgs;
25 using ::testing::SaveArg; 24 using ::testing::SaveArg;
26 25
27 namespace media { 26 namespace media {
28 class VideoFrame; 27 class VideoFrame;
(...skipping 30 matching lines...) Expand all
59 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} 58 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {}
60 virtual ~DesktopCaptureDeviceAuraTest() {} 59 virtual ~DesktopCaptureDeviceAuraTest() {}
61 60
62 protected: 61 protected:
63 virtual void SetUp() OVERRIDE { 62 virtual void SetUp() OVERRIDE {
64 // The ContextFactory must exist before any Compositors are created. 63 // The ContextFactory must exist before any Compositors are created.
65 bool enable_pixel_output = false; 64 bool enable_pixel_output = false;
66 ui::InitializeContextFactoryForTests(enable_pixel_output); 65 ui::InitializeContextFactoryForTests(enable_pixel_output);
67 helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); 66 helper_.reset(new aura::test::AuraTestHelper(&message_loop_));
68 helper_->SetUp(); 67 helper_->SetUp();
69 new wm::DefaultActivationClient(helper_->root_window());
70 68
71 // We need a window to cover desktop area so that DesktopCaptureDeviceAura 69 // We need a window to cover desktop area so that DesktopCaptureDeviceAura
72 // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the 70 // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the
73 // root window associated with the primary display. 71 // root window associated with the primary display.
74 gfx::Rect desktop_bounds = root_window()->bounds(); 72 gfx::Rect desktop_bounds = root_window()->bounds();
75 window_delegate_.reset(new aura::test::TestWindowDelegate()); 73 window_delegate_.reset(new aura::test::TestWindowDelegate());
76 desktop_window_.reset(new aura::Window(window_delegate_.get())); 74 desktop_window_.reset(new aura::Window(window_delegate_.get()));
77 desktop_window_->Init(aura::WINDOW_LAYER_TEXTURED); 75 desktop_window_->Init(aura::WINDOW_LAYER_TEXTURED);
78 desktop_window_->SetBounds(desktop_bounds); 76 desktop_window_->SetBounds(desktop_bounds);
79 aura::client::ParentWindowWithContext( 77 aura::client::ParentWindowWithContext(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 capture_params.requested_format.frame_rate = kFrameRate; 113 capture_params.requested_format.frame_rate = kFrameRate;
116 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; 114 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420;
117 capture_params.allow_resolution_change = false; 115 capture_params.allow_resolution_change = false;
118 capture_device->AllocateAndStart( 116 capture_device->AllocateAndStart(
119 capture_params, client.PassAs<media::VideoCaptureDevice::Client>()); 117 capture_params, client.PassAs<media::VideoCaptureDevice::Client>());
120 capture_device->StopAndDeAllocate(); 118 capture_device->StopAndDeAllocate();
121 } 119 }
122 120
123 } // namespace 121 } // namespace
124 } // namespace content 122 } // namespace content
OLDNEW
« no previous file with comments | « content/DEPS ('k') | content/browser/renderer_host/render_widget_host_view_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698