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.h" | 7 #include "base/message_loop.h" |
8 #include "ui/aura/client/aura_constants.h" | 8 #include "ui/aura/client/aura_constants.h" |
9 #include "ui/aura/env.h" | 9 #include "ui/aura/env.h" |
10 #include "ui/aura/focus_manager.h" | 10 #include "ui/aura/focus_manager.h" |
11 #include "ui/aura/monitor_manager.h" | 11 #include "ui/aura/display_manager.h" |
12 #include "ui/aura/root_window.h" | 12 #include "ui/aura/root_window.h" |
13 #include "ui/aura/shared/root_window_capture_client.h" | 13 #include "ui/aura/shared/root_window_capture_client.h" |
14 #include "ui/aura/single_monitor_manager.h" | 14 #include "ui/aura/single_display_manager.h" |
15 #include "ui/aura/test/test_activation_client.h" | 15 #include "ui/aura/test/test_activation_client.h" |
16 #include "ui/aura/test/test_screen.h" | 16 #include "ui/aura/test/test_screen.h" |
17 #include "ui/aura/test/test_stacking_client.h" | 17 #include "ui/aura/test/test_stacking_client.h" |
18 #include "ui/aura/ui_controls_aura.h" | 18 #include "ui/aura/ui_controls_aura.h" |
19 #include "ui/base/test/dummy_input_method.h" | 19 #include "ui/base/test/dummy_input_method.h" |
20 #include "ui/compositor/layer_animator.h" | 20 #include "ui/compositor/layer_animator.h" |
21 #include "ui/gfx/screen.h" | 21 #include "ui/gfx/screen.h" |
22 #include "ui/ui_controls/ui_controls.h" | 22 #include "ui/ui_controls/ui_controls.h" |
23 | 23 |
24 namespace aura { | 24 namespace aura { |
(...skipping 11 matching lines...) Expand all Loading... |
36 | 36 |
37 AuraTestHelper::~AuraTestHelper() { | 37 AuraTestHelper::~AuraTestHelper() { |
38 CHECK(setup_called_) | 38 CHECK(setup_called_) |
39 << "You have overridden SetUp but never called super class's SetUp"; | 39 << "You have overridden SetUp but never called super class's SetUp"; |
40 CHECK(teardown_called_) | 40 CHECK(teardown_called_) |
41 << "You have overridden TearDown but never called super class's TearDown"; | 41 << "You have overridden TearDown but never called super class's TearDown"; |
42 } | 42 } |
43 | 43 |
44 void AuraTestHelper::SetUp() { | 44 void AuraTestHelper::SetUp() { |
45 setup_called_ = true; | 45 setup_called_ = true; |
46 Env::GetInstance()->SetMonitorManager(new SingleMonitorManager); | 46 Env::GetInstance()->SetDisplayManager(new SingleDisplayManager); |
47 root_window_.reset(aura::MonitorManager::CreateRootWindowForPrimaryMonitor()); | 47 root_window_.reset(aura::DisplayManager::CreateRootWindowForPrimaryDisplay()); |
48 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); | 48 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); |
49 ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_.get())); | 49 ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_.get())); |
50 | 50 |
51 focus_manager_.reset(new FocusManager); | 51 focus_manager_.reset(new FocusManager); |
52 root_window_->set_focus_manager(focus_manager_.get()); | 52 root_window_->set_focus_manager(focus_manager_.get()); |
53 stacking_client_.reset(new TestStackingClient(root_window_.get())); | 53 stacking_client_.reset(new TestStackingClient(root_window_.get())); |
54 test_activation_client_.reset( | 54 test_activation_client_.reset( |
55 new test::TestActivationClient(root_window_.get())); | 55 new test::TestActivationClient(root_window_.get())); |
56 root_window_capture_client_.reset( | 56 root_window_capture_client_.reset( |
57 new shared::RootWindowCaptureClient(root_window_.get())); | 57 new shared::RootWindowCaptureClient(root_window_.get())); |
(...skipping 20 matching lines...) Expand all Loading... |
78 | 78 |
79 void AuraTestHelper::RunAllPendingInMessageLoop() { | 79 void AuraTestHelper::RunAllPendingInMessageLoop() { |
80 #if !defined(OS_MACOSX) | 80 #if !defined(OS_MACOSX) |
81 message_loop_->RunAllPendingWithDispatcher( | 81 message_loop_->RunAllPendingWithDispatcher( |
82 Env::GetInstance()->GetDispatcher()); | 82 Env::GetInstance()->GetDispatcher()); |
83 #endif | 83 #endif |
84 } | 84 } |
85 | 85 |
86 } // namespace test | 86 } // namespace test |
87 } // namespace aura | 87 } // namespace aura |
OLD | NEW |