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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 AuraTestHelper::~AuraTestHelper() { | 53 AuraTestHelper::~AuraTestHelper() { |
54 CHECK(setup_called_) | 54 CHECK(setup_called_) |
55 << "AuraTestHelper::SetUp() never called."; | 55 << "AuraTestHelper::SetUp() never called."; |
56 CHECK(teardown_called_) | 56 CHECK(teardown_called_) |
57 << "AuraTestHelper::TearDown() never called."; | 57 << "AuraTestHelper::TearDown() never called."; |
58 } | 58 } |
59 | 59 |
60 void AuraTestHelper::SetUp() { | 60 void AuraTestHelper::SetUp() { |
61 setup_called_ = true; | 61 setup_called_ = true; |
| 62 |
| 63 bool allow_test_contexts = true; |
| 64 ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts); |
| 65 |
62 Env::GetInstance(); | 66 Env::GetInstance(); |
63 test_screen_.reset(TestScreen::Create()); | 67 test_screen_.reset(TestScreen::Create()); |
64 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); | 68 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); |
65 root_window_.reset(test_screen_->CreateRootWindowForPrimaryDisplay()); | 69 root_window_.reset(test_screen_->CreateRootWindowForPrimaryDisplay()); |
66 | 70 |
67 focus_client_.reset(new FocusManager); | 71 focus_client_.reset(new FocusManager); |
68 client::SetFocusClient(root_window_.get(), focus_client_.get()); | 72 client::SetFocusClient(root_window_.get(), focus_client_.get()); |
69 stacking_client_.reset(new TestStackingClient(root_window_.get())); | 73 stacking_client_.reset(new TestStackingClient(root_window_.get())); |
70 test_activation_client_.reset( | 74 test_activation_client_.reset( |
71 new test::TestActivationClient(root_window_.get())); | 75 new test::TestActivationClient(root_window_.get())); |
(...skipping 30 matching lines...) Expand all Loading... |
102 #if !defined(OS_MACOSX) | 106 #if !defined(OS_MACOSX) |
103 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them | 107 // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them |
104 // use run_loop.QuitClosure(). | 108 // use run_loop.QuitClosure(). |
105 base::RunLoop run_loop(Env::GetInstance()->GetDispatcher()); | 109 base::RunLoop run_loop(Env::GetInstance()->GetDispatcher()); |
106 run_loop.RunUntilIdle(); | 110 run_loop.RunUntilIdle(); |
107 #endif | 111 #endif |
108 } | 112 } |
109 | 113 |
110 } // namespace test | 114 } // namespace test |
111 } // namespace aura | 115 } // namespace aura |
OLD | NEW |