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_delegate_aura.h" | 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
9 #include "ash/common/test/material_design_controller_test_api.h" | 9 #include "ash/common/test/material_design_controller_test_api.h" |
10 #include "ash/common/test/test_session_state_delegate.h" | 10 #include "ash/common/test/test_session_state_delegate.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 display::ResetDisplayIdForTest(); | 76 display::ResetDisplayIdForTest(); |
77 wm_state_ = base::MakeUnique<::wm::WMState>(); | 77 wm_state_ = base::MakeUnique<::wm::WMState>(); |
78 views_delegate_ = ash_test_environment_->CreateViewsDelegate(); | 78 views_delegate_ = ash_test_environment_->CreateViewsDelegate(); |
79 | 79 |
80 // Disable animations during tests. | 80 // Disable animations during tests. |
81 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( | 81 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( |
82 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); | 82 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); |
83 ui::InitializeInputMethodForTesting(); | 83 ui::InitializeInputMethodForTesting(); |
84 | 84 |
85 bool enable_pixel_output = false; | 85 bool enable_pixel_output = false; |
86 ui::ContextFactory* context_factory = | 86 ui::ContextFactory* context_factory = nullptr; |
87 ui::InitializeContextFactoryForTests(enable_pixel_output); | 87 ui::ContextFactoryPrivate* context_factory_private = nullptr; |
| 88 ui::InitializeContextFactoryForTests(enable_pixel_output, &context_factory, |
| 89 &context_factory_private); |
88 | 90 |
89 // Creates Shell and hook with Desktop. | 91 // Creates Shell and hook with Desktop. |
90 if (!test_shell_delegate_) | 92 if (!test_shell_delegate_) |
91 test_shell_delegate_ = new TestShellDelegate; | 93 test_shell_delegate_ = new TestShellDelegate; |
92 | 94 |
93 // Creates MessageCenter since g_browser_process is not created in AshTestBase | 95 // Creates MessageCenter since g_browser_process is not created in AshTestBase |
94 // tests. | 96 // tests. |
95 message_center::MessageCenter::Initialize(); | 97 message_center::MessageCenter::Initialize(); |
96 | 98 |
97 #if defined(OS_CHROMEOS) | 99 #if defined(OS_CHROMEOS) |
(...skipping 26 matching lines...) Expand all Loading... |
124 ui::MaterialDesignController::Initialize(); | 126 ui::MaterialDesignController::Initialize(); |
125 ash::MaterialDesignController::Initialize(); | 127 ash::MaterialDesignController::Initialize(); |
126 if (material_mode == MaterialDesignController::Mode::UNINITIALIZED) | 128 if (material_mode == MaterialDesignController::Mode::UNINITIALIZED) |
127 material_mode = MaterialDesignController::GetMode(); | 129 material_mode = MaterialDesignController::GetMode(); |
128 material_design_state_.reset( | 130 material_design_state_.reset( |
129 new test::MaterialDesignControllerTestAPI(material_mode)); | 131 new test::MaterialDesignControllerTestAPI(material_mode)); |
130 | 132 |
131 ShellInitParams init_params; | 133 ShellInitParams init_params; |
132 init_params.delegate = test_shell_delegate_; | 134 init_params.delegate = test_shell_delegate_; |
133 init_params.context_factory = context_factory; | 135 init_params.context_factory = context_factory; |
| 136 init_params.context_factory_private = context_factory_private; |
134 init_params.blocking_pool = ash_test_environment_->GetBlockingPool(); | 137 init_params.blocking_pool = ash_test_environment_->GetBlockingPool(); |
135 Shell::CreateInstance(init_params); | 138 Shell::CreateInstance(init_params); |
136 aura::test::EnvTestHelper(aura::Env::GetInstance()) | 139 aura::test::EnvTestHelper(aura::Env::GetInstance()) |
137 .SetInputStateLookup(std::unique_ptr<aura::InputStateLookup>()); | 140 .SetInputStateLookup(std::unique_ptr<aura::InputStateLookup>()); |
138 | 141 |
139 Shell* shell = Shell::GetInstance(); | 142 Shell* shell = Shell::GetInstance(); |
140 if (start_session) { | 143 if (start_session) { |
141 GetTestSessionStateDelegate()->SetActiveUserSessionStarted(true); | 144 GetTestSessionStateDelegate()->SetActiveUserSessionStarted(true); |
142 GetTestSessionStateDelegate()->SetHasActiveUser(true); | 145 GetTestSessionStateDelegate()->SetHasActiveUser(true); |
143 } | 146 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 bool AshTestHelper::SupportsMultipleDisplays() { | 224 bool AshTestHelper::SupportsMultipleDisplays() { |
222 #if defined(OS_WIN) | 225 #if defined(OS_WIN) |
223 return false; | 226 return false; |
224 #else | 227 #else |
225 return true; | 228 return true; |
226 #endif | 229 #endif |
227 } | 230 } |
228 | 231 |
229 } // namespace test | 232 } // namespace test |
230 } // namespace ash | 233 } // namespace ash |
OLD | NEW |