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_capture_client.h" | 10 #include "ui/aura/client/default_capture_client.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 << "AuraTestHelper::TearDown() never called."; | 53 << "AuraTestHelper::TearDown() never called."; |
54 } | 54 } |
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( | 63 EnvTestHelper(Env::GetInstance()).SetInputStateLookup(nullptr); |
64 scoped_ptr<InputStateLookup>()); | |
65 | 64 |
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()); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 106 |
108 void AuraTestHelper::RunAllPendingInMessageLoop() { | 107 void AuraTestHelper::RunAllPendingInMessageLoop() { |
109 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them | 108 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them |
110 // use run_loop.QuitClosure(). | 109 // use run_loop.QuitClosure(). |
111 base::RunLoop run_loop; | 110 base::RunLoop run_loop; |
112 run_loop.RunUntilIdle(); | 111 run_loop.RunUntilIdle(); |
113 } | 112 } |
114 | 113 |
115 } // namespace test | 114 } // namespace test |
116 } // namespace aura | 115 } // namespace aura |
OLD | NEW |