blob: b89fa91684dae89d6c77db57abcf24e03c2a57f7 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/wm/overlay_layout_manager.h"
#include <memory>
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/views/widget/widget.h"
namespace ash {
namespace {
using OverlayLayoutManagerTest = AshTestBase;
// Verifies that a fullscreen widget in the overlay container has its bounds
// updated when the display rotates.
TEST_F(OverlayLayoutManagerTest, FullscreenWidgetWithDisplayRotation) {
// Create a fullscreen widget in the overlay container.
std::unique_ptr<views::Widget> widget =
CreateTestWidget(nullptr, kShellWindowId_OverlayContainer);
EXPECT_EQ(gfx::Rect(0, 0, 800, 600), widget->GetWindowBoundsInScreen());
// Widget bounds update after display rotation.
EXPECT_EQ(gfx::Rect(0, 0, 600, 800), widget->GetWindowBoundsInScreen());
} // namespace
} // namespace ash