OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/test/ash_test_helper.h" | 5 #include "ash/test/ash_test_helper.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/test/display_manager_test_api.h" | 10 #include "ash/test/display_manager_test_api.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 void AshTestHelper::SetUp(bool start_session) { | 53 void AshTestHelper::SetUp(bool start_session) { |
54 wm_state_.reset(new views::corewm::WMState); | 54 wm_state_.reset(new views::corewm::WMState); |
55 | 55 |
56 // Disable animations during tests. | 56 // Disable animations during tests. |
57 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( | 57 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( |
58 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); | 58 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); |
59 ui::InitializeInputMethodForTesting(); | 59 ui::InitializeInputMethodForTesting(); |
60 | 60 |
61 bool allow_test_contexts = true; | 61 bool enable_pixel_output = false; |
62 ui::InitializeContextFactoryForTests(allow_test_contexts); | 62 ui::InitializeContextFactoryForTests(enable_pixel_output); |
63 | 63 |
64 // Creates Shell and hook with Desktop. | 64 // Creates Shell and hook with Desktop. |
65 test_shell_delegate_ = new TestShellDelegate; | 65 test_shell_delegate_ = new TestShellDelegate; |
66 | 66 |
67 // Creates MessageCenter since g_browser_process is not created in AshTestBase | 67 // Creates MessageCenter since g_browser_process is not created in AshTestBase |
68 // tests. | 68 // tests. |
69 message_center::MessageCenter::Initialize(); | 69 message_center::MessageCenter::Initialize(); |
70 | 70 |
71 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) |
72 // Create DBusThreadManager for testing. | 72 // Create DBusThreadManager for testing. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 aura::Window* AshTestHelper::CurrentContext() { | 139 aura::Window* AshTestHelper::CurrentContext() { |
140 aura::Window* root_window = Shell::GetTargetRootWindow(); | 140 aura::Window* root_window = Shell::GetTargetRootWindow(); |
141 if (!root_window) | 141 if (!root_window) |
142 root_window = Shell::GetPrimaryRootWindow(); | 142 root_window = Shell::GetPrimaryRootWindow(); |
143 DCHECK(root_window); | 143 DCHECK(root_window); |
144 return root_window; | 144 return root_window; |
145 } | 145 } |
146 | 146 |
147 } // namespace test | 147 } // namespace test |
148 } // namespace ash | 148 } // namespace ash |
OLD | NEW |