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/default_capture_client.h" | 9 #include "ui/aura/client/default_capture_client.h" |
10 #include "ui/aura/client/focus_client.h" | 10 #include "ui/aura/client/focus_client.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 void AuraTestHelper::SetUp(ui::ContextFactory* context_factory) { | 56 void AuraTestHelper::SetUp(ui::ContextFactory* context_factory) { |
57 setup_called_ = true; | 57 setup_called_ = true; |
58 | 58 |
59 Env::CreateInstance(true); | 59 Env::CreateInstance(true); |
60 Env::GetInstance()->set_context_factory(context_factory); | 60 Env::GetInstance()->set_context_factory(context_factory); |
61 // Unit tests generally don't want to query the system, rather use the state | 61 // Unit tests generally don't want to query the system, rather use the state |
62 // from RootWindow. | 62 // from RootWindow. |
63 EnvTestHelper(Env::GetInstance()).SetInputStateLookup(nullptr); | 63 EnvTestHelper(Env::GetInstance()).SetInputStateLookup(nullptr); |
64 | 64 |
65 ui::SetUpInputMethodFactoryForTesting(); | |
66 ui::InitializeInputMethodForTesting(); | 65 ui::InitializeInputMethodForTesting(); |
67 | 66 |
68 gfx::Size host_size(800, 600); | 67 gfx::Size host_size(800, 600); |
69 test_screen_.reset(TestScreen::Create(host_size)); | 68 test_screen_.reset(TestScreen::Create(host_size)); |
70 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); | 69 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); |
71 host_.reset(test_screen_->CreateHostForPrimaryDisplay()); | 70 host_.reset(test_screen_->CreateHostForPrimaryDisplay()); |
72 | 71 |
73 focus_client_.reset(new TestFocusClient); | 72 focus_client_.reset(new TestFocusClient); |
74 client::SetFocusClient(root_window(), focus_client_.get()); | 73 client::SetFocusClient(root_window(), focus_client_.get()); |
75 stacking_client_.reset(new TestWindowTreeClient(root_window())); | 74 stacking_client_.reset(new TestWindowTreeClient(root_window())); |
(...skipping 26 matching lines...) Expand all Loading... |
102 | 101 |
103 void AuraTestHelper::RunAllPendingInMessageLoop() { | 102 void AuraTestHelper::RunAllPendingInMessageLoop() { |
104 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them | 103 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them |
105 // use run_loop.QuitClosure(). | 104 // use run_loop.QuitClosure(). |
106 base::RunLoop run_loop; | 105 base::RunLoop run_loop; |
107 run_loop.RunUntilIdle(); | 106 run_loop.RunUntilIdle(); |
108 } | 107 } |
109 | 108 |
110 } // namespace test | 109 } // namespace test |
111 } // namespace aura | 110 } // namespace aura |
OLD | NEW |