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

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

Issue 2728803002: Handles users rotating screen too early (Closed)
Patch Set: Make ScreenRotationAnimator handle its own internal states. Created 3 years, 9 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_delegate_aura.h" 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
8 #include "ash/common/test/test_session_state_delegate.h" 8 #include "ash/common/test/test_session_state_delegate.h"
9 #include "ash/common/test/test_system_tray_delegate.h" 9 #include "ash/common/test/test_system_tray_delegate.h"
10 #include "ash/common/test/wm_shell_test_api.h" 10 #include "ash/common/test/wm_shell_test_api.h"
11 #include "ash/common/wm_shell.h" 11 #include "ash/common/wm_shell.h"
12 #include "ash/common/wm_window.h" 12 #include "ash/common/wm_window.h"
13 #include "ash/mus/screen_mus.h" 13 #include "ash/mus/screen_mus.h"
14 #include "ash/mus/window_manager.h" 14 #include "ash/mus/window_manager.h"
15 #include "ash/mus/window_manager_application.h" 15 #include "ash/mus/window_manager_application.h"
16 #include "ash/shell.h" 16 #include "ash/shell.h"
17 #include "ash/shell_init_params.h" 17 #include "ash/shell_init_params.h"
18 #include "ash/system/chromeos/screen_layout_observer.h" 18 #include "ash/system/chromeos/screen_layout_observer.h"
19 #include "ash/test/ash_test_environment.h" 19 #include "ash/test/ash_test_environment.h"
20 #include "ash/test/ash_test_views_delegate.h" 20 #include "ash/test/ash_test_views_delegate.h"
21 #include "ash/test/shell_test_api.h" 21 #include "ash/test/display_configuration_controller_test_api.h"
22 #include "ash/test/test_screenshot_delegate.h" 22 #include "ash/test/test_screenshot_delegate.h"
23 #include "ash/test/test_shell_delegate.h" 23 #include "ash/test/test_shell_delegate.h"
24 #include "base/memory/ptr_util.h" 24 #include "base/memory/ptr_util.h"
25 #include "base/run_loop.h" 25 #include "base/run_loop.h"
26 #include "base/strings/string_split.h" 26 #include "base/strings/string_split.h"
27 #include "base/test/sequenced_worker_pool_owner.h" 27 #include "base/test/sequenced_worker_pool_owner.h"
28 #include "chromeos/audio/cras_audio_handler.h" 28 #include "chromeos/audio/cras_audio_handler.h"
29 #include "chromeos/dbus/dbus_thread_manager.h" 29 #include "chromeos/dbus/dbus_thread_manager.h"
30 #include "device/bluetooth/bluetooth_adapter_factory.h" 30 #include "device/bluetooth/bluetooth_adapter_factory.h"
31 #include "device/bluetooth/dbus/bluez_dbus_manager.h" 31 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // ScreenLayoutObserver is specific to classic-ash. 151 // ScreenLayoutObserver is specific to classic-ash.
152 // Tests that change the display configuration generally don't care about 152 // Tests that change the display configuration generally don't care about
153 // the notifications and the popup UI can interfere with things like 153 // the notifications and the popup UI can interfere with things like
154 // cursors. 154 // cursors.
155 shell->screen_layout_observer()->set_show_notifications_for_testing(false); 155 shell->screen_layout_observer()->set_show_notifications_for_testing(false);
156 156
157 // DisplayManager is specific to classic-ash. 157 // DisplayManager is specific to classic-ash.
158 display::test::DisplayManagerTestApi( 158 display::test::DisplayManagerTestApi(
159 Shell::GetInstance()->display_manager()) 159 Shell::GetInstance()->display_manager())
160 .DisableChangeDisplayUponHostResize(); 160 .DisableChangeDisplayUponHostResize();
161 ShellTestApi(shell).DisableDisplayAnimator(); 161 DisplayConfigurationControllerTestApi(
162 shell->display_configuration_controller())
163 .DisableDisplayAnimator();
162 164
163 // TODO: disabled for mash as AcceleratorControllerDelegateAura isn't 165 // TODO: disabled for mash as AcceleratorControllerDelegateAura isn't
164 // created in mash http://crbug.com/632111. 166 // created in mash http://crbug.com/632111.
165 test_screenshot_delegate_ = new TestScreenshotDelegate(); 167 test_screenshot_delegate_ = new TestScreenshotDelegate();
166 shell->accelerator_controller_delegate()->SetScreenshotDelegate( 168 shell->accelerator_controller_delegate()->SetScreenshotDelegate(
167 std::unique_ptr<ScreenshotDelegate>(test_screenshot_delegate_)); 169 std::unique_ptr<ScreenshotDelegate>(test_screenshot_delegate_));
168 } 170 }
169 } 171 }
170 172
171 void AshTestHelper::TearDown() { 173 void AshTestHelper::TearDown() {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 std::set<RootWindowController*> roots = 366 std::set<RootWindowController*> roots =
365 window_manager_app_->window_manager()->GetRootWindowControllers(); 367 window_manager_app_->window_manager()->GetRootWindowControllers();
366 std::vector<RootWindowController*> ordered_roots; 368 std::vector<RootWindowController*> ordered_roots;
367 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end()); 369 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end());
368 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId); 370 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId);
369 return ordered_roots; 371 return ordered_roots;
370 } 372 }
371 373
372 } // namespace test 374 } // namespace test
373 } // namespace ash 375 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698