Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(635)

Unified Diff: ash/wm/window_state_unittest.cc

Issue 2692663002: Gut ash::MaterialDesignController, and remove the about:flags entry. (Closed)
Patch Set: terry review Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_positioner_unittest.cc ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_state_unittest.cc
diff --git a/ash/wm/window_state_unittest.cc b/ash/wm/window_state_unittest.cc
index c37d8c2946debc18736d0d8b34f43bc7c528521b..b04883c4c92eef6d4c1c2ff1c9493ad59bd323e7 100644
--- a/ash/wm/window_state_unittest.cc
+++ b/ash/wm/window_state_unittest.cc
@@ -6,11 +6,10 @@
#include <utility>
-#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/window_state_util.h"
#include "ash/common/wm/wm_event.h"
-#include "ash/test/ash_md_test_base.h"
+#include "ash/test/ash_test_base.h"
#include "ash/wm/window_state_aura.h"
#include "ash/wm/window_util.h"
#include "services/ui/public/interfaces/window_manager_constants.mojom.h"
@@ -53,18 +52,11 @@ class AlwaysMaximizeTestState : public WindowState::State {
} // namespace
-using WindowStateTest = test::AshMDTestBase;
-
-INSTANTIATE_TEST_CASE_P(
- /* prefix intentionally left blank due to only one parameterization */,
- WindowStateTest,
- testing::Values(MaterialDesignController::NON_MATERIAL,
- MaterialDesignController::MATERIAL_NORMAL,
- MaterialDesignController::MATERIAL_EXPERIMENTAL));
+using WindowStateTest = test::AshTestBase;
// Test that a window gets properly snapped to the display's edges in a
// multi monitor environment.
-TEST_P(WindowStateTest, SnapWindowBasic) {
+TEST_F(WindowStateTest, SnapWindowBasic) {
UpdateDisplay("0+0-500x400, 0+500-600x400");
const gfx::Rect kPrimaryDisplayWorkAreaBounds =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
@@ -106,7 +98,7 @@ TEST_P(WindowStateTest, SnapWindowBasic) {
// Test how the minimum and maximum size specified by the aura::WindowDelegate
// affect snapping.
-TEST_P(WindowStateTest, SnapWindowMinimumSize) {
+TEST_F(WindowStateTest, SnapWindowMinimumSize) {
UpdateDisplay("0+0-600x900");
const gfx::Rect kWorkAreaBounds =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
@@ -139,7 +131,7 @@ TEST_P(WindowStateTest, SnapWindowMinimumSize) {
}
// Test that the minimum size specified by aura::WindowDelegate gets respected.
-TEST_P(WindowStateTest, TestRespectMinimumSize) {
+TEST_F(WindowStateTest, TestRespectMinimumSize) {
UpdateDisplay("0+0-1024x768");
aura::test::TestWindowDelegate delegate;
@@ -166,7 +158,7 @@ TEST_P(WindowStateTest, TestRespectMinimumSize) {
// Test that the minimum window size specified by aura::WindowDelegate does not
// exceed the screen size.
-TEST_P(WindowStateTest, TestIgnoreTooBigMinimumSize) {
+TEST_F(WindowStateTest, TestIgnoreTooBigMinimumSize) {
UpdateDisplay("0+0-1024x768");
const gfx::Size work_area_size =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area().size();
@@ -194,7 +186,7 @@ TEST_P(WindowStateTest, TestIgnoreTooBigMinimumSize) {
}
// Test that setting the bounds of a snapped window keeps its snapped.
-TEST_P(WindowStateTest, SnapWindowSetBounds) {
+TEST_F(WindowStateTest, SnapWindowSetBounds) {
UpdateDisplay("0+0-900x600");
const gfx::Rect kWorkAreaBounds =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
@@ -218,7 +210,7 @@ TEST_P(WindowStateTest, SnapWindowSetBounds) {
}
// Test that snapping left/right preserves the restore bounds.
-TEST_P(WindowStateTest, RestoreBounds) {
+TEST_F(WindowStateTest, RestoreBounds) {
std::unique_ptr<aura::Window> window(
CreateTestWindowInShellWithBounds(gfx::Rect(100, 100, 100, 100)));
WindowState* window_state = GetWindowState(window.get());
@@ -259,7 +251,7 @@ TEST_P(WindowStateTest, RestoreBounds) {
// Test that maximizing an auto managed window, then snapping it puts the window
// at the snapped bounds and not at the auto-managed (centered) bounds.
-TEST_P(WindowStateTest, AutoManaged) {
+TEST_F(WindowStateTest, AutoManaged) {
std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
WindowState* window_state = GetWindowState(window.get());
window_state->set_window_position_managed(true);
@@ -284,7 +276,7 @@ TEST_P(WindowStateTest, AutoManaged) {
}
// Test that the replacement of a State object works as expected.
-TEST_P(WindowStateTest, SimpleStateSwap) {
+TEST_F(WindowStateTest, SimpleStateSwap) {
std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
WindowState* window_state = GetWindowState(window.get());
EXPECT_FALSE(window_state->IsMaximized());
@@ -295,7 +287,7 @@ TEST_P(WindowStateTest, SimpleStateSwap) {
// Test that the replacement of a state object, following a restore with the
// original one restores the window to its original state.
-TEST_P(WindowStateTest, StateSwapRestore) {
+TEST_F(WindowStateTest, StateSwapRestore) {
std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
WindowState* window_state = GetWindowState(window.get());
EXPECT_FALSE(window_state->IsMaximized());
@@ -309,7 +301,7 @@ TEST_P(WindowStateTest, StateSwapRestore) {
// Tests that a window that had same bounds as the work area shrinks after the
// window is maximized and then restored.
-TEST_P(WindowStateTest, RestoredWindowBoundsShrink) {
+TEST_F(WindowStateTest, RestoredWindowBoundsShrink) {
UpdateDisplay("0+0-600x900");
std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
WindowState* window_state = GetWindowState(window.get());
@@ -328,15 +320,13 @@ TEST_P(WindowStateTest, RestoredWindowBoundsShrink) {
EXPECT_TRUE(work_area.Contains(window->bounds()));
}
-TEST_P(WindowStateTest, DoNotResizeMaximizedWindowInFullscreen) {
- const int height_offset = GetMdMaximizedWindowHeightOffset();
-
+TEST_F(WindowStateTest, DoNotResizeMaximizedWindowInFullscreen) {
std::unique_ptr<aura::Window> maximized(CreateTestWindowInShellWithId(0));
std::unique_ptr<aura::Window> fullscreen(CreateTestWindowInShellWithId(1));
WindowState* maximized_state = GetWindowState(maximized.get());
maximized_state->Maximize();
ASSERT_TRUE(maximized_state->IsMaximized());
- EXPECT_EQ(gfx::Rect(0, 0, 800, 553 + height_offset).ToString(),
+ EXPECT_EQ(gfx::Rect(0, 0, 800, 552).ToString(),
Daniel Erat 2017/02/13 23:17:01 have to admit that i don't like all of these magic
Evan Stade 2017/02/14 16:35:12 yea, not sure why this wasn't always kTestConstant
maximized->GetBoundsInScreen().ToString());
// Entering fullscreen mode will not update the maximized window's size
@@ -346,7 +336,7 @@ TEST_P(WindowStateTest, DoNotResizeMaximizedWindowInFullscreen) {
fullscreen_state->OnWMEvent(&fullscreen_event);
ASSERT_TRUE(fullscreen_state->IsFullscreen());
ASSERT_TRUE(maximized_state->IsMaximized());
- EXPECT_EQ(gfx::Rect(0, 0, 800, 553 + height_offset).ToString(),
+ EXPECT_EQ(gfx::Rect(0, 0, 800, 552).ToString(),
maximized->GetBoundsInScreen().ToString());
// Updating display size will update the maximum window size.
@@ -355,11 +345,11 @@ TEST_P(WindowStateTest, DoNotResizeMaximizedWindowInFullscreen) {
fullscreen.reset();
// Exiting fullscreen will update the maximized window to the work area.
- EXPECT_EQ(gfx::Rect(0, 0, 900, 653 + height_offset).ToString(),
+ EXPECT_EQ(gfx::Rect(0, 0, 900, 652).ToString(),
maximized->GetBoundsInScreen().ToString());
}
-TEST_P(WindowStateTest, TrustedPinned) {
+TEST_F(WindowStateTest, TrustedPinned) {
std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
WindowState* window_state = GetWindowState(window.get());
EXPECT_FALSE(window_state->IsTrustedPinned());
@@ -386,7 +376,7 @@ TEST_P(WindowStateTest, TrustedPinned) {
EXPECT_FALSE(window_state->IsTrustedPinned());
}
-TEST_P(WindowStateTest, AllowSetBoundsInMaximized) {
+TEST_F(WindowStateTest, AllowSetBoundsInMaximized) {
std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
WindowState* window_state = GetWindowState(window.get());
EXPECT_FALSE(window_state->IsMaximized());
@@ -419,7 +409,7 @@ TEST_P(WindowStateTest, AllowSetBoundsInMaximized) {
EXPECT_EQ(work_area, window->bounds());
}
-TEST_P(WindowStateTest, FullscreenMinimizedSwitching) {
+TEST_F(WindowStateTest, FullscreenMinimizedSwitching) {
std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
WindowState* window_state = GetWindowState(window.get());
« no previous file with comments | « ash/wm/window_positioner_unittest.cc ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698