| 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/display/screen_orientation_controller_chromeos.h" | 5 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 -cos(degrees * kDegreesToRadians) * kMeanGravity, | 403 -cos(degrees * kDegreesToRadians) * kMeanGravity, |
| 404 0.0f); | 404 0.0f); |
| 405 TriggerLidUpdate(gravity); | 405 TriggerLidUpdate(gravity); |
| 406 EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation()); | 406 EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation()); |
| 407 | 407 |
| 408 SetRotationLocked(false); | 408 SetRotationLocked(false); |
| 409 TriggerLidUpdate(gravity); | 409 TriggerLidUpdate(gravity); |
| 410 EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation()); | 410 EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation()); |
| 411 } | 411 } |
| 412 | 412 |
| 413 // The TrayDisplay class that is responsible for adding/updating MessageCenter | 413 // The ScreenLayoutObserver class that is responsible for adding/updating |
| 414 // notifications is only added to the SystemTray on ChromeOS. | 414 // MessageCenter notifications is only added to the SystemTray on ChromeOS. |
| 415 // Tests that the screen rotation notifications are suppressed when | 415 // Tests that the screen rotation notifications are suppressed when |
| 416 // triggered by the accelerometer. | 416 // triggered by the accelerometer. |
| 417 TEST_F(ScreenOrientationControllerTest, BlockRotationNotifications) { | 417 TEST_F(ScreenOrientationControllerTest, BlockRotationNotifications) { |
| 418 EnableMaximizeMode(true); | 418 EnableMaximizeMode(true); |
| 419 test::TestSystemTrayDelegate* tray_delegate = GetSystemTrayDelegate(); | 419 test::TestSystemTrayDelegate* tray_delegate = GetSystemTrayDelegate(); |
| 420 tray_delegate->set_should_show_display_notification(true); | 420 tray_delegate->set_should_show_display_notification(true); |
| 421 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay(); | 421 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay(); |
| 422 | 422 |
| 423 message_center::MessageCenter* message_center = | 423 message_center::MessageCenter* message_center = |
| 424 message_center::MessageCenter::Get(); | 424 message_center::MessageCenter::Get(); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 | 651 |
| 652 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation( | 652 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation( |
| 653 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE); | 653 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE); |
| 654 | 654 |
| 655 EXPECT_EQ( | 655 EXPECT_EQ( |
| 656 kNewRotation, | 656 kNewRotation, |
| 657 display_manager->GetDisplayInfo(kInternalDisplayId).GetActiveRotation()); | 657 display_manager->GetDisplayInfo(kInternalDisplayId).GetActiveRotation()); |
| 658 } | 658 } |
| 659 | 659 |
| 660 } // namespace ash | 660 } // namespace ash |
| OLD | NEW |