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

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

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (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
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"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 test_shell_content_state_ = new TestShellContentState; 111 test_shell_content_state_ = new TestShellContentState;
112 content_state = test_shell_content_state_; 112 content_state = test_shell_content_state_;
113 } 113 }
114 ShellContentState::SetInstance(content_state); 114 ShellContentState::SetInstance(content_state);
115 115
116 ShellInitParams init_params; 116 ShellInitParams init_params;
117 init_params.delegate = test_shell_delegate_; 117 init_params.delegate = test_shell_delegate_;
118 init_params.context_factory = context_factory; 118 init_params.context_factory = context_factory;
119 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); 119 init_params.blocking_pool = content::BrowserThread::GetBlockingPool();
120 ash::Shell::CreateInstance(init_params); 120 ash::Shell::CreateInstance(init_params);
121 aura::test::EnvTestHelper(aura::Env::GetInstance()).SetInputStateLookup( 121 aura::test::EnvTestHelper(aura::Env::GetInstance())
122 scoped_ptr<aura::InputStateLookup>()); 122 .SetInputStateLookup(std::unique_ptr<aura::InputStateLookup>());
123 123
124 Shell* shell = Shell::GetInstance(); 124 Shell* shell = Shell::GetInstance();
125 if (start_session) { 125 if (start_session) {
126 GetTestSessionStateDelegate()->SetActiveUserSessionStarted(true); 126 GetTestSessionStateDelegate()->SetActiveUserSessionStarted(true);
127 GetTestSessionStateDelegate()->SetHasActiveUser(true); 127 GetTestSessionStateDelegate()->SetHasActiveUser(true);
128 } 128 }
129 129
130 test::DisplayManagerTestApi().DisableChangeDisplayUponHostResize(); 130 test::DisplayManagerTestApi().DisableChangeDisplayUponHostResize();
131 ShellTestApi(shell).DisableDisplayAnimator(); 131 ShellTestApi(shell).DisableDisplayAnimator();
132 132
133 test_screenshot_delegate_ = new TestScreenshotDelegate(); 133 test_screenshot_delegate_ = new TestScreenshotDelegate();
134 shell->accelerator_controller()->SetScreenshotDelegate( 134 shell->accelerator_controller()->SetScreenshotDelegate(
135 scoped_ptr<ScreenshotDelegate>(test_screenshot_delegate_)); 135 std::unique_ptr<ScreenshotDelegate>(test_screenshot_delegate_));
136 } 136 }
137 137
138 void AshTestHelper::TearDown() { 138 void AshTestHelper::TearDown() {
139 // Tear down the shell. 139 // Tear down the shell.
140 Shell::DeleteInstance(); 140 Shell::DeleteInstance();
141 ShellContentState::DestroyInstance(); 141 ShellContentState::DestroyInstance();
142 142
143 test_screenshot_delegate_ = NULL; 143 test_screenshot_delegate_ = NULL;
144 144
145 // Remove global message center state. 145 // Remove global message center state.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 bool AshTestHelper::SupportsHostWindowResize() { 204 bool AshTestHelper::SupportsHostWindowResize() {
205 #if defined(OS_WIN) 205 #if defined(OS_WIN)
206 return false; 206 return false;
207 #else 207 #else
208 return true; 208 return true;
209 #endif 209 #endif
210 } 210 }
211 211
212 } // namespace test 212 } // namespace test
213 } // namespace ash 213 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698