overlay_layout_manager_unittest.cc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/wm/overlay_layout_manager.h"
  5. #include <memory>
  6. #include "ash/public/cpp/shell_window_ids.h"
  7. #include "ash/test/ash_test_base.h"
  8. #include "ui/gfx/geometry/rect.h"
  9. #include "ui/views/widget/widget.h"
  10. namespace ash {
  11. namespace {
  12. using OverlayLayoutManagerTest = AshTestBase;
  13. // Verifies that a fullscreen widget in the overlay container has its bounds
  14. // updated when the display rotates. https://crbug.com/869130
  15. TEST_F(OverlayLayoutManagerTest, FullscreenWidgetWithDisplayRotation) {
  16. UpdateDisplay("800x600");
  17. // Create a fullscreen widget in the overlay container.
  18. std::unique_ptr<views::Widget> widget =
  19. CreateTestWidget(nullptr, kShellWindowId_OverlayContainer);
  20. widget->SetFullscreen(true);
  21. EXPECT_EQ(gfx::Rect(0, 0, 800, 600), widget->GetWindowBoundsInScreen());
  22. // Widget bounds update after display rotation.
  23. UpdateDisplay("800x600/r");
  24. EXPECT_EQ(gfx::Rect(0, 0, 600, 800), widget->GetWindowBoundsInScreen());
  25. }
  26. } // namespace
  27. } // namespace ash