| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/system/chromeos/rotation/tray_rotation_lock.h" | 5 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // rotation locked, and that the tray view becomes visible. | 225 // rotation locked, and that the tray view becomes visible. |
| 226 TEST_F(TrayRotationLockTest, PerformActionOnDefaultView) { | 226 TEST_F(TrayRotationLockTest, PerformActionOnDefaultView) { |
| 227 MaximizeModeController* maximize_mode_controller = Shell::GetInstance()-> | 227 MaximizeModeController* maximize_mode_controller = Shell::GetInstance()-> |
| 228 maximize_mode_controller(); | 228 maximize_mode_controller(); |
| 229 ScreenOrientationController* screen_orientation_controller = | 229 ScreenOrientationController* screen_orientation_controller = |
| 230 Shell::GetInstance()->screen_orientation_controller(); | 230 Shell::GetInstance()->screen_orientation_controller(); |
| 231 ASSERT_FALSE(screen_orientation_controller->rotation_locked()); | 231 ASSERT_FALSE(screen_orientation_controller->rotation_locked()); |
| 232 maximize_mode_controller->EnableMaximizeModeWindowManager(true); | 232 maximize_mode_controller->EnableMaximizeModeWindowManager(true); |
| 233 ASSERT_FALSE(tray_view()->visible()); | 233 ASSERT_FALSE(tray_view()->visible()); |
| 234 | 234 |
| 235 ui::GestureEvent tap( | 235 ui::GestureEvent tap(0, 0, 0, base::TimeTicks(), |
| 236 0, 0, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_TAP)); | 236 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); |
| 237 default_view()->OnGestureEvent(&tap); | 237 default_view()->OnGestureEvent(&tap); |
| 238 EXPECT_TRUE(screen_orientation_controller->rotation_locked()); | 238 EXPECT_TRUE(screen_orientation_controller->rotation_locked()); |
| 239 EXPECT_TRUE(tray_view()->visible()); | 239 EXPECT_TRUE(tray_view()->visible()); |
| 240 | 240 |
| 241 maximize_mode_controller->EnableMaximizeModeWindowManager(false); | 241 maximize_mode_controller->EnableMaximizeModeWindowManager(false); |
| 242 } | 242 } |
| 243 | 243 |
| 244 // Tests that when the tray is created without the internal display being known, | 244 // Tests that when the tray is created without the internal display being known, |
| 245 // that it will still display correctly once the internal display is known. | 245 // that it will still display correctly once the internal display is known. |
| 246 TEST_F(TrayRotationLockTest, InternalDisplayNotAvailableAtCreation) { | 246 TEST_F(TrayRotationLockTest, InternalDisplayNotAvailableAtCreation) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 270 ->EnableMaximizeModeWindowManager(true); | 270 ->EnableMaximizeModeWindowManager(true); |
| 271 DestroyTrayView(); | 271 DestroyTrayView(); |
| 272 Shell::GetInstance()->screen_orientation_controller()->SetRotationLocked( | 272 Shell::GetInstance()->screen_orientation_controller()->SetRotationLocked( |
| 273 true); | 273 true); |
| 274 Shell::GetInstance() | 274 Shell::GetInstance() |
| 275 ->maximize_mode_controller() | 275 ->maximize_mode_controller() |
| 276 ->EnableMaximizeModeWindowManager(false); | 276 ->EnableMaximizeModeWindowManager(false); |
| 277 } | 277 } |
| 278 | 278 |
| 279 } // namespace ash | 279 } // namespace ash |
| OLD | NEW |