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" |
27 #include "ui/base/ime/input_method_factory.h" | 28 #include "ui/base/ime/input_method_factory.h" |
28 #include "ui/base/ime/input_method_initializer.h" | 29 #include "ui/base/ime/input_method_initializer.h" |
29 #include "ui/base/platform_window_defaults.h" | 30 #include "ui/base/platform_window_defaults.h" |
30 #include "ui/compositor/compositor.h" | 31 #include "ui/compositor/compositor.h" |
31 #include "ui/compositor/layer_animator.h" | 32 #include "ui/compositor/layer_animator.h" |
32 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 33 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
33 #include "ui/display/screen.h" | 34 #include "ui/display/screen.h" |
34 #include "ui/wm/core/wm_state.h" | 35 #include "ui/wm/core/wm_state.h" |
35 | 36 |
36 #if defined(USE_X11) | 37 #if defined(USE_X11) |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 ui::InitializeInputMethodForTesting(); | 123 ui::InitializeInputMethodForTesting(); |
123 | 124 |
124 display::Screen* screen = display::Screen::GetScreen(); | 125 display::Screen* screen = display::Screen::GetScreen(); |
125 gfx::Size host_size(screen ? screen->GetPrimaryDisplay().GetSizeInPixel() | 126 gfx::Size host_size(screen ? screen->GetPrimaryDisplay().GetSizeInPixel() |
126 : gfx::Size(800, 600)); | 127 : gfx::Size(800, 600)); |
127 // TODO(sky): creating the screen and host should not happen for mus. | 128 // TODO(sky): creating the screen and host should not happen for mus. |
128 test_screen_.reset(TestScreen::Create(host_size)); | 129 test_screen_.reset(TestScreen::Create(host_size)); |
129 if (!screen) | 130 if (!screen) |
130 display::Screen::SetScreenInstance(test_screen_.get()); | 131 display::Screen::SetScreenInstance(test_screen_.get()); |
131 host_.reset(test_screen_->CreateHostForPrimaryDisplay()); | 132 host_.reset(test_screen_->CreateHostForPrimaryDisplay()); |
| 133 host_->window()->SetEventTargeter( |
| 134 std::unique_ptr<ui::EventTargeter>(new WindowTargeter())); |
132 | 135 |
133 client::SetFocusClient(root_window(), focus_client_.get()); | 136 client::SetFocusClient(root_window(), focus_client_.get()); |
134 client::SetCaptureClient(root_window(), capture_client()); | 137 client::SetCaptureClient(root_window(), capture_client()); |
135 parenting_client_.reset(new TestWindowParentingClient(root_window())); | 138 parenting_client_.reset(new TestWindowParentingClient(root_window())); |
136 | 139 |
137 root_window()->Show(); | 140 root_window()->Show(); |
138 // Ensure width != height so tests won't confuse them. | 141 // Ensure width != height so tests won't confuse them. |
139 host()->SetBoundsInPixels(gfx::Rect(host_size)); | 142 host()->SetBoundsInPixels(gfx::Rect(host_size)); |
140 | 143 |
141 if (mode_ == Mode::MUS_CREATE_WINDOW_TREE_CLIENT) | 144 if (mode_ == Mode::MUS_CREATE_WINDOW_TREE_CLIENT) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 window_tree_client_setup_ = base::MakeUnique<TestWindowTreeClientSetup>(); | 196 window_tree_client_setup_ = base::MakeUnique<TestWindowTreeClientSetup>(); |
194 window_tree_client_setup_->InitForWindowManager(window_tree_delegate_, | 197 window_tree_client_setup_->InitForWindowManager(window_tree_delegate_, |
195 window_manager_delegate_); | 198 window_manager_delegate_); |
196 window_tree_client_ = window_tree_client_setup_->window_tree_client(); | 199 window_tree_client_ = window_tree_client_setup_->window_tree_client(); |
197 window_tree_client_->capture_synchronizer()->AttachToCaptureClient( | 200 window_tree_client_->capture_synchronizer()->AttachToCaptureClient( |
198 capture_client_.get()); | 201 capture_client_.get()); |
199 } | 202 } |
200 | 203 |
201 } // namespace test | 204 } // namespace test |
202 } // namespace aura | 205 } // namespace aura |
OLD | NEW |