Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: ash/test/ash_test_helper.cc

Issue 1878943002: Revert of Makes MaterialDesignController initialization explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/app/chrome_main_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/display/display_info.h" 9 #include "ash/display/display_info.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/shell_init_params.h" 11 #include "ash/shell_init_params.h"
12 #include "ash/test/ash_test_views_delegate.h" 12 #include "ash/test/ash_test_views_delegate.h"
13 #include "ash/test/content/test_shell_content_state.h" 13 #include "ash/test/content/test_shell_content_state.h"
14 #include "ash/test/display_manager_test_api.h" 14 #include "ash/test/display_manager_test_api.h"
15 #include "ash/test/shell_test_api.h" 15 #include "ash/test/shell_test_api.h"
16 #include "ash/test/test_screenshot_delegate.h" 16 #include "ash/test/test_screenshot_delegate.h"
17 #include "ash/test/test_session_state_delegate.h" 17 #include "ash/test/test_session_state_delegate.h"
18 #include "ash/test/test_shell_delegate.h" 18 #include "ash/test/test_shell_delegate.h"
19 #include "ash/test/test_system_tray_delegate.h" 19 #include "ash/test/test_system_tray_delegate.h"
20 #include "base/run_loop.h" 20 #include "base/run_loop.h"
21 #include "content/public/browser/browser_thread.h" 21 #include "content/public/browser/browser_thread.h"
22 #include "ui/aura/env.h" 22 #include "ui/aura/env.h"
23 #include "ui/aura/input_state_lookup.h" 23 #include "ui/aura/input_state_lookup.h"
24 #include "ui/aura/test/env_test_helper.h" 24 #include "ui/aura/test/env_test_helper.h"
25 #include "ui/aura/test/event_generator_delegate_aura.h" 25 #include "ui/aura/test/event_generator_delegate_aura.h"
26 #include "ui/base/ime/input_method_initializer.h" 26 #include "ui/base/ime/input_method_initializer.h"
27 #include "ui/base/material_design/material_design_controller.h"
28 #include "ui/base/test/material_design_controller_test_api.h"
29 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 27 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
30 #include "ui/compositor/test/context_factories_for_test.h" 28 #include "ui/compositor/test/context_factories_for_test.h"
31 #include "ui/message_center/message_center.h" 29 #include "ui/message_center/message_center.h"
32 #include "ui/wm/core/capture_controller.h" 30 #include "ui/wm/core/capture_controller.h"
33 31
34 #if defined(OS_CHROMEOS) 32 #if defined(OS_CHROMEOS)
35 #include "chromeos/audio/cras_audio_handler.h" 33 #include "chromeos/audio/cras_audio_handler.h"
36 #include "chromeos/dbus/dbus_thread_manager.h" 34 #include "chromeos/dbus/dbus_thread_manager.h"
37 #include "device/bluetooth/dbus/bluez_dbus_manager.h" 35 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
38 #endif 36 #endif
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // created in AshTestBase tests. 106 // created in AshTestBase tests.
109 chromeos::CrasAudioHandler::InitializeForTesting(); 107 chromeos::CrasAudioHandler::InitializeForTesting();
110 #endif 108 #endif
111 ShellContentState* content_state = content_state_; 109 ShellContentState* content_state = content_state_;
112 if (!content_state) { 110 if (!content_state) {
113 test_shell_content_state_ = new TestShellContentState; 111 test_shell_content_state_ = new TestShellContentState;
114 content_state = test_shell_content_state_; 112 content_state = test_shell_content_state_;
115 } 113 }
116 ShellContentState::SetInstance(content_state); 114 ShellContentState::SetInstance(content_state);
117 115
118 // ContentTestSuiteBase might have already initialized
119 // MaterialDesignController in unit_tests suite.
120 ui::test::MaterialDesignControllerTestAPI::UninitializeMode();
121 ui::MaterialDesignController::Initialize();
122 ShellInitParams init_params; 116 ShellInitParams init_params;
123 init_params.delegate = test_shell_delegate_; 117 init_params.delegate = test_shell_delegate_;
124 init_params.context_factory = context_factory; 118 init_params.context_factory = context_factory;
125 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); 119 init_params.blocking_pool = content::BrowserThread::GetBlockingPool();
126 ash::Shell::CreateInstance(init_params); 120 ash::Shell::CreateInstance(init_params);
127 aura::test::EnvTestHelper(aura::Env::GetInstance()).SetInputStateLookup( 121 aura::test::EnvTestHelper(aura::Env::GetInstance()).SetInputStateLookup(
128 scoped_ptr<aura::InputStateLookup>()); 122 scoped_ptr<aura::InputStateLookup>());
129 123
130 Shell* shell = Shell::GetInstance(); 124 Shell* shell = Shell::GetInstance();
131 if (start_session) { 125 if (start_session) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 bool AshTestHelper::SupportsHostWindowResize() { 204 bool AshTestHelper::SupportsHostWindowResize() {
211 #if defined(OS_WIN) 205 #if defined(OS_WIN)
212 return false; 206 return false;
213 #else 207 #else
214 return true; 208 return true;
215 #endif 209 #endif
216 } 210 }
217 211
218 } // namespace test 212 } // namespace test
219 } // namespace ash 213 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/app/chrome_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698