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/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/default_activation_client.h" | 10 #include "ui/aura/client/default_activation_client.h" |
11 #include "ui/aura/client/default_capture_client.h" | 11 #include "ui/aura/client/default_capture_client.h" |
12 #include "ui/aura/client/focus_client.h" | 12 #include "ui/aura/client/focus_client.h" |
13 #include "ui/aura/env.h" | 13 #include "ui/aura/env.h" |
14 #include "ui/aura/input_state_lookup.h" | 14 #include "ui/aura/input_state_lookup.h" |
15 #include "ui/aura/root_window.h" | 15 #include "ui/aura/root_window.h" |
16 #include "ui/aura/test/env_test_helper.h" | 16 #include "ui/aura/test/env_test_helper.h" |
17 #include "ui/aura/test/test_focus_client.h" | 17 #include "ui/aura/test/test_focus_client.h" |
18 #include "ui/aura/test/test_screen.h" | 18 #include "ui/aura/test/test_screen.h" |
19 #include "ui/aura/test/test_stacking_client.h" | 19 #include "ui/aura/test/test_window_tree_client.h" |
20 #include "ui/base/ime/dummy_input_method.h" | 20 #include "ui/base/ime/dummy_input_method.h" |
21 #include "ui/compositor/compositor.h" | 21 #include "ui/compositor/compositor.h" |
22 #include "ui/compositor/layer_animator.h" | 22 #include "ui/compositor/layer_animator.h" |
23 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 23 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
24 #include "ui/gfx/screen.h" | 24 #include "ui/gfx/screen.h" |
25 | 25 |
26 #if defined(USE_X11) | 26 #if defined(USE_X11) |
27 #include "ui/aura/root_window_host_x11.h" | 27 #include "ui/aura/root_window_host_x11.h" |
28 #include "ui/base/x/x11_util.h" | 28 #include "ui/base/x/x11_util.h" |
29 #endif | 29 #endif |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // from RootWindow. | 72 // from RootWindow. |
73 EnvTestHelper(Env::GetInstance()).SetInputStateLookup( | 73 EnvTestHelper(Env::GetInstance()).SetInputStateLookup( |
74 scoped_ptr<InputStateLookup>()); | 74 scoped_ptr<InputStateLookup>()); |
75 | 75 |
76 test_screen_.reset(TestScreen::Create()); | 76 test_screen_.reset(TestScreen::Create()); |
77 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); | 77 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); |
78 root_window_.reset(test_screen_->CreateRootWindowForPrimaryDisplay()); | 78 root_window_.reset(test_screen_->CreateRootWindowForPrimaryDisplay()); |
79 | 79 |
80 focus_client_.reset(new TestFocusClient); | 80 focus_client_.reset(new TestFocusClient); |
81 client::SetFocusClient(root_window_.get(), focus_client_.get()); | 81 client::SetFocusClient(root_window_.get(), focus_client_.get()); |
82 stacking_client_.reset(new TestStackingClient(root_window_.get())); | 82 stacking_client_.reset(new TestWindowTreeClient(root_window_.get())); |
83 activation_client_.reset( | 83 activation_client_.reset( |
84 new client::DefaultActivationClient(root_window_.get())); | 84 new client::DefaultActivationClient(root_window_.get())); |
85 capture_client_.reset(new client::DefaultCaptureClient(root_window_.get())); | 85 capture_client_.reset(new client::DefaultCaptureClient(root_window_.get())); |
86 test_input_method_.reset(new ui::DummyInputMethod); | 86 test_input_method_.reset(new ui::DummyInputMethod); |
87 root_window_->SetProperty( | 87 root_window_->SetProperty( |
88 client::kRootWindowInputMethodKey, | 88 client::kRootWindowInputMethodKey, |
89 test_input_method_.get()); | 89 test_input_method_.get()); |
90 | 90 |
91 root_window_->Show(); | 91 root_window_->Show(); |
92 // Ensure width != height so tests won't confuse them. | 92 // Ensure width != height so tests won't confuse them. |
(...skipping 20 matching lines...) Expand all Loading... |
113 | 113 |
114 void AuraTestHelper::RunAllPendingInMessageLoop() { | 114 void AuraTestHelper::RunAllPendingInMessageLoop() { |
115 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them | 115 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them |
116 // use run_loop.QuitClosure(). | 116 // use run_loop.QuitClosure(). |
117 base::RunLoop run_loop(Env::GetInstance()->GetDispatcher()); | 117 base::RunLoop run_loop(Env::GetInstance()->GetDispatcher()); |
118 run_loop.RunUntilIdle(); | 118 run_loop.RunUntilIdle(); |
119 } | 119 } |
120 | 120 |
121 } // namespace test | 121 } // namespace test |
122 } // namespace aura | 122 } // namespace aura |
OLD | NEW |