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

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

Issue 2072023003: mash: Break ash system tray dependencies on ash::ShelfWidget (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 | « ash/test/ash_test_base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/test/ash_test_base.h" 5 #include "ash/test/ash_test_base.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/ash_switches.h" 10 #include "ash/common/ash_switches.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 #if defined(OS_WIN) 166 #if defined(OS_WIN)
167 ui::test::SetUsePopupAsRootWindowForTest(false); 167 ui::test::SetUsePopupAsRootWindowForTest(false);
168 #endif 168 #endif
169 169
170 event_generator_.reset(); 170 event_generator_.reset();
171 // Some tests set an internal display id, 171 // Some tests set an internal display id,
172 // reset it here, so other tests will continue in a clean environment. 172 // reset it here, so other tests will continue in a clean environment.
173 display::Display::SetInternalDisplayId(display::Display::kInvalidDisplayID); 173 display::Display::SetInternalDisplayId(display::Display::kInvalidDisplayID);
174 } 174 }
175 175
176 // static
177 SystemTray* AshTestBase::GetPrimarySystemTray() {
178 return Shell::GetInstance()->GetPrimarySystemTray();
179 }
180
176 ui::test::EventGenerator& AshTestBase::GetEventGenerator() { 181 ui::test::EventGenerator& AshTestBase::GetEventGenerator() {
177 if (!event_generator_) { 182 if (!event_generator_) {
178 event_generator_.reset( 183 event_generator_.reset(
179 new ui::test::EventGenerator(new AshEventGeneratorDelegate())); 184 new ui::test::EventGenerator(new AshEventGeneratorDelegate()));
180 } 185 }
181 return *event_generator_.get(); 186 return *event_generator_.get();
182 } 187 }
183 188
184 // static 189 // static
185 display::Display::Rotation AshTestBase::GetActiveDisplayRotation(int64_t id) { 190 display::Display::Rotation AshTestBase::GetActiveDisplayRotation(int64_t id) {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 } 284 }
280 285
281 void AshTestBase::RunAllPendingInMessageLoop() { 286 void AshTestBase::RunAllPendingInMessageLoop() {
282 ash_test_helper_->RunAllPendingInMessageLoop(); 287 ash_test_helper_->RunAllPendingInMessageLoop();
283 } 288 }
284 289
285 TestScreenshotDelegate* AshTestBase::GetScreenshotDelegate() { 290 TestScreenshotDelegate* AshTestBase::GetScreenshotDelegate() {
286 return ash_test_helper_->test_screenshot_delegate(); 291 return ash_test_helper_->test_screenshot_delegate();
287 } 292 }
288 293
289 SystemTray* AshTestBase::GetPrimarySystemTray() {
290 return Shell::GetInstance()->GetPrimarySystemTray();
291 }
292
293 TestSystemTrayDelegate* AshTestBase::GetSystemTrayDelegate() { 294 TestSystemTrayDelegate* AshTestBase::GetSystemTrayDelegate() {
294 return static_cast<TestSystemTrayDelegate*>( 295 return static_cast<TestSystemTrayDelegate*>(
295 WmShell::Get()->system_tray_delegate()); 296 WmShell::Get()->system_tray_delegate());
296 } 297 }
297 298
298 void AshTestBase::SetSessionStarted(bool session_started) { 299 void AshTestBase::SetSessionStarted(bool session_started) {
299 AshTestHelper::GetTestSessionStateDelegate()->SetActiveUserSessionStarted( 300 AshTestHelper::GetTestSessionStateDelegate()->SetActiveUserSessionStarted(
300 session_started); 301 session_started);
301 } 302 }
302 303
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 356
356 void AshTestBase::DisableIME() { 357 void AshTestBase::DisableIME() {
357 Shell::GetInstance()->RemovePreTargetHandler( 358 Shell::GetInstance()->RemovePreTargetHandler(
358 Shell::GetInstance() 359 Shell::GetInstance()
359 ->window_tree_host_manager() 360 ->window_tree_host_manager()
360 ->input_method_event_handler()); 361 ->input_method_event_handler());
361 } 362 }
362 363
363 } // namespace test 364 } // namespace test
364 } // namespace ash 365 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/ash_test_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698