| Index: ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
|
| diff --git a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
|
| index d619fd5239dd9885cfa172987272bdb5893686e3..2479f38eac088260b560277b86dc53eb9df24cfa 100644
|
| --- a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
|
| +++ b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
|
| @@ -9,9 +9,11 @@
|
| #include "ash/shell.h"
|
| #include "ash/test/ash_test_base.h"
|
| #include "ash/test/display_manager_test_api.h"
|
| +#include "ash/test/test_system_tray_delegate.h"
|
| #include "ui/aura/test/event_generator.h"
|
| #include "ui/events/event_handler.h"
|
| #include "ui/gfx/vector3d_f.h"
|
| +#include "ui/message_center/message_center.h"
|
|
|
| namespace ash {
|
|
|
| @@ -416,4 +418,39 @@ TEST_F(MaximizeModeControllerTest, ExitingMaximizeModeClearRotationLock) {
|
| EXPECT_FALSE(maximize_mode_controller()->rotation_locked());
|
| }
|
|
|
| +TEST_F(MaximizeModeControllerTest, BlockRotationNotifications) {
|
| + test::TestSystemTrayDelegate* tray_delegate =
|
| + static_cast<test::TestSystemTrayDelegate*>(
|
| + Shell::GetInstance()->system_tray_delegate());
|
| + tray_delegate->set_should_show_display_notification(true);
|
| +
|
| + aura::Window* root = Shell::GetPrimaryRootWindow();
|
| + aura::test::EventGenerator event_generator(root, root);
|
| + message_center::MessageCenter* message_center =
|
| + message_center::MessageCenter::Get();
|
| +
|
| + DisplayManager* display_manager =
|
| + Shell::GetInstance()->display_manager();
|
| +
|
| + // Make sure notifications are still displayed when
|
| + // adjusting the screen rotation directly
|
| + ASSERT_EQ(0u, message_center->NotificationCount());
|
| + ASSERT_EQ(gfx::Display::ROTATE_0, display_manager->GetDisplayInfo(
|
| + gfx::Display::InternalDisplayId()).rotation());
|
| + display_manager->SetDisplayRotation(gfx::Display::InternalDisplayId(),
|
| + gfx::Display::ROTATE_90);
|
| + ASSERT_EQ(1u, message_center->NotificationCount());
|
| + message_center->RemoveAllNotifications(false);
|
| + ASSERT_EQ(0u, message_center->NotificationCount());
|
| +
|
| + //
|
| + // Trigger maximize mode by opening to 270.
|
| + TriggerAccelerometerUpdate(gfx::Vector3dF(0.0f, 0.0f, -1.0f),
|
| + gfx::Vector3dF(-1.0f, 0.0f, 0.0f));
|
| + // Rotate to 90 degrees
|
| + TriggerAccelerometerUpdate(gfx::Vector3dF(0.0f, 1.0f, 0.0f),
|
| + gfx::Vector3dF(0.0f, 1.0f, 0.0f));
|
| + EXPECT_EQ(0u, message_center->NotificationCount());
|
| +}
|
| +
|
| } // namespace ash
|
|
|