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/base/ime/input_method_factory.h" | 27 #include "ui/base/ime/input_method_factory.h" |
28 #include "ui/base/ime/input_method_initializer.h" | 28 #include "ui/base/ime/input_method_initializer.h" |
| 29 #include "ui/base/platform_window_defaults.h" |
29 #include "ui/compositor/compositor.h" | 30 #include "ui/compositor/compositor.h" |
30 #include "ui/compositor/layer_animator.h" | 31 #include "ui/compositor/layer_animator.h" |
31 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 32 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
32 #include "ui/display/screen.h" | 33 #include "ui/display/screen.h" |
33 #include "ui/wm/core/wm_state.h" | 34 #include "ui/wm/core/wm_state.h" |
34 | 35 |
35 #if defined(USE_X11) | 36 #if defined(USE_X11) |
36 #include "ui/aura/window_tree_host_x11.h" | |
37 #include "ui/base/x/x11_util.h" // nogncheck | 37 #include "ui/base/x/x11_util.h" // nogncheck |
38 #endif | 38 #endif |
39 | 39 |
40 namespace aura { | 40 namespace aura { |
41 namespace test { | 41 namespace test { |
42 namespace { | 42 namespace { |
43 | 43 |
44 AuraTestHelper* g_instance = nullptr; | 44 AuraTestHelper* g_instance = nullptr; |
45 | 45 |
46 } // namespace | 46 } // namespace |
47 | 47 |
48 AuraTestHelper::AuraTestHelper(base::MessageLoopForUI* message_loop) | 48 AuraTestHelper::AuraTestHelper(base::MessageLoopForUI* message_loop) |
49 : setup_called_(false), teardown_called_(false) { | 49 : setup_called_(false), teardown_called_(false) { |
50 DCHECK(message_loop); | 50 DCHECK(message_loop); |
51 // Disable animations during tests. | 51 // Disable animations during tests. |
52 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( | 52 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( |
53 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); | 53 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); |
54 #if defined(USE_X11) | 54 ui::test::EnableTestConfigForPlatformWindows(); |
55 test::SetUseOverrideRedirectWindowByDefault(true); | |
56 #endif | |
57 InitializeAuraEventGeneratorDelegate(); | 55 InitializeAuraEventGeneratorDelegate(); |
58 } | 56 } |
59 | 57 |
60 AuraTestHelper::~AuraTestHelper() { | 58 AuraTestHelper::~AuraTestHelper() { |
61 CHECK(setup_called_) | 59 CHECK(setup_called_) |
62 << "AuraTestHelper::SetUp() never called."; | 60 << "AuraTestHelper::SetUp() never called."; |
63 CHECK(teardown_called_) | 61 CHECK(teardown_called_) |
64 << "AuraTestHelper::TearDown() never called."; | 62 << "AuraTestHelper::TearDown() never called."; |
65 } | 63 } |
66 | 64 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 window_tree_client_setup_ = base::MakeUnique<TestWindowTreeClientSetup>(); | 193 window_tree_client_setup_ = base::MakeUnique<TestWindowTreeClientSetup>(); |
196 window_tree_client_setup_->InitForWindowManager(window_tree_delegate_, | 194 window_tree_client_setup_->InitForWindowManager(window_tree_delegate_, |
197 window_manager_delegate_); | 195 window_manager_delegate_); |
198 window_tree_client_ = window_tree_client_setup_->window_tree_client(); | 196 window_tree_client_ = window_tree_client_setup_->window_tree_client(); |
199 window_tree_client_->capture_synchronizer()->AttachToCaptureClient( | 197 window_tree_client_->capture_synchronizer()->AttachToCaptureClient( |
200 capture_client_.get()); | 198 capture_client_.get()); |
201 } | 199 } |
202 | 200 |
203 } // namespace test | 201 } // namespace test |
204 } // namespace aura | 202 } // namespace aura |
OLD | NEW |