OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/aura/test/aura_test_helper.h" | 5 #include "ui/aura/test/aura_test_helper.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "ui/aura/client/default_capture_client.h" | 10 #include "ui/aura/client/default_capture_client.h" |
11 #include "ui/aura/client/focus_client.h" | 11 #include "ui/aura/client/focus_client.h" |
12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
13 #include "ui/aura/input_state_lookup.h" | 13 #include "ui/aura/input_state_lookup.h" |
14 #include "ui/aura/mus/capture_synchronizer.h" | 14 #include "ui/aura/mus/capture_synchronizer.h" |
15 #include "ui/aura/mus/window_port_mus.h" | 15 #include "ui/aura/mus/window_port_mus.h" |
16 #include "ui/aura/mus/window_tree_client.h" | 16 #include "ui/aura/mus/window_tree_client.h" |
17 #include "ui/aura/test/env_test_helper.h" | 17 #include "ui/aura/test/env_test_helper.h" |
18 #include "ui/aura/test/event_generator_delegate_aura.h" | 18 #include "ui/aura/test/event_generator_delegate_aura.h" |
19 #include "ui/aura/test/mus/test_window_tree.h" | 19 #include "ui/aura/test/mus/test_window_tree.h" |
20 #include "ui/aura/test/mus/test_window_tree_client_setup.h" | 20 #include "ui/aura/test/mus/test_window_tree_client_setup.h" |
21 #include "ui/aura/test/test_focus_client.h" | 21 #include "ui/aura/test/test_focus_client.h" |
22 #include "ui/aura/test/test_screen.h" | 22 #include "ui/aura/test/test_screen.h" |
23 #include "ui/aura/test/test_window_parenting_client.h" | 23 #include "ui/aura/test/test_window_parenting_client.h" |
24 #include "ui/aura/window.h" | 24 #include "ui/aura/window.h" |
25 #include "ui/aura/window_event_dispatcher.h" | 25 #include "ui/aura/window_event_dispatcher.h" |
26 #include "ui/aura/window_port_local.h" | 26 #include "ui/aura/window_port_local.h" |
27 #include "ui/aura/window_targeter.h" | |
28 #include "ui/base/ime/input_method_factory.h" | 27 #include "ui/base/ime/input_method_factory.h" |
29 #include "ui/base/ime/input_method_initializer.h" | 28 #include "ui/base/ime/input_method_initializer.h" |
30 #include "ui/base/platform_window_defaults.h" | 29 #include "ui/base/platform_window_defaults.h" |
31 #include "ui/compositor/compositor.h" | 30 #include "ui/compositor/compositor.h" |
32 #include "ui/compositor/layer_animator.h" | 31 #include "ui/compositor/layer_animator.h" |
33 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 32 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
34 #include "ui/display/screen.h" | 33 #include "ui/display/screen.h" |
35 #include "ui/wm/core/wm_state.h" | 34 #include "ui/wm/core/wm_state.h" |
36 | 35 |
37 #if defined(USE_X11) | 36 #if defined(USE_X11) |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 ui::InitializeInputMethodForTesting(); | 122 ui::InitializeInputMethodForTesting(); |
124 | 123 |
125 display::Screen* screen = display::Screen::GetScreen(); | 124 display::Screen* screen = display::Screen::GetScreen(); |
126 gfx::Size host_size(screen ? screen->GetPrimaryDisplay().GetSizeInPixel() | 125 gfx::Size host_size(screen ? screen->GetPrimaryDisplay().GetSizeInPixel() |
127 : gfx::Size(800, 600)); | 126 : gfx::Size(800, 600)); |
128 // TODO(sky): creating the screen and host should not happen for mus. | 127 // TODO(sky): creating the screen and host should not happen for mus. |
129 test_screen_.reset(TestScreen::Create(host_size)); | 128 test_screen_.reset(TestScreen::Create(host_size)); |
130 if (!screen) | 129 if (!screen) |
131 display::Screen::SetScreenInstance(test_screen_.get()); | 130 display::Screen::SetScreenInstance(test_screen_.get()); |
132 host_.reset(test_screen_->CreateHostForPrimaryDisplay()); | 131 host_.reset(test_screen_->CreateHostForPrimaryDisplay()); |
133 host_->window()->SetEventTargeter( | |
134 std::unique_ptr<ui::EventTargeter>(new WindowTargeter())); | |
135 | 132 |
136 client::SetFocusClient(root_window(), focus_client_.get()); | 133 client::SetFocusClient(root_window(), focus_client_.get()); |
137 client::SetCaptureClient(root_window(), capture_client()); | 134 client::SetCaptureClient(root_window(), capture_client()); |
138 parenting_client_.reset(new TestWindowParentingClient(root_window())); | 135 parenting_client_.reset(new TestWindowParentingClient(root_window())); |
139 | 136 |
140 root_window()->Show(); | 137 root_window()->Show(); |
141 // Ensure width != height so tests won't confuse them. | 138 // Ensure width != height so tests won't confuse them. |
142 host()->SetBoundsInPixels(gfx::Rect(host_size)); | 139 host()->SetBoundsInPixels(gfx::Rect(host_size)); |
143 | 140 |
144 if (mode_ == Mode::MUS_CREATE_WINDOW_TREE_CLIENT) | 141 if (mode_ == Mode::MUS_CREATE_WINDOW_TREE_CLIENT) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 window_tree_client_setup_ = base::MakeUnique<TestWindowTreeClientSetup>(); | 193 window_tree_client_setup_ = base::MakeUnique<TestWindowTreeClientSetup>(); |
197 window_tree_client_setup_->InitForWindowManager(window_tree_delegate_, | 194 window_tree_client_setup_->InitForWindowManager(window_tree_delegate_, |
198 window_manager_delegate_); | 195 window_manager_delegate_); |
199 window_tree_client_ = window_tree_client_setup_->window_tree_client(); | 196 window_tree_client_ = window_tree_client_setup_->window_tree_client(); |
200 window_tree_client_->capture_synchronizer()->AttachToCaptureClient( | 197 window_tree_client_->capture_synchronizer()->AttachToCaptureClient( |
201 capture_client_.get()); | 198 capture_client_.get()); |
202 } | 199 } |
203 | 200 |
204 } // namespace test | 201 } // namespace test |
205 } // namespace aura | 202 } // namespace aura |
OLD | NEW |