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

Unified Diff: ash/wm/window_positioner_unittest.cc

Issue 2692663002: Gut ash::MaterialDesignController, and remove the about:flags entry. (Closed)
Patch Set: yet another rebase 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/drag_window_resizer_unittest.cc ('k') | ash/wm/window_state_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_positioner_unittest.cc
diff --git a/ash/wm/window_positioner_unittest.cc b/ash/wm/window_positioner_unittest.cc
index c12721144871e20e873364589c7516d3bcc583f0..2bda5d7999c056b0e2a8463ac097b88c16a9b79b 100644
--- a/ash/wm/window_positioner_unittest.cc
+++ b/ash/wm/window_positioner_unittest.cc
@@ -6,7 +6,6 @@
#include <string>
-#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/scoped_root_window_for_new_windows.h"
#include "ash/common/wm/window_positioner.h"
#include "ash/common/wm/window_state.h"
@@ -14,7 +13,7 @@
#include "ash/common/wm_window.h"
#include "ash/shell.h"
#include "ash/shell/toplevel_window.h"
-#include "ash/test/ash_md_test_base.h"
+#include "ash/test/ash_test_base.h"
#include "ash/test/test_shell_delegate.h"
#include "ash/wm/window_state_aura.h"
#include "base/strings/string_number_conversions.h"
@@ -24,17 +23,9 @@
namespace ash {
-using WindowPositionerTest = test::AshMDTestBase;
+using WindowPositionerTest = test::AshTestBase;
-INSTANTIATE_TEST_CASE_P(
- /* prefix intentionally left blank due to only one parameterization */,
- WindowPositionerTest,
- testing::Values(MaterialDesignController::NON_MATERIAL,
- MaterialDesignController::MATERIAL_NORMAL,
- MaterialDesignController::MATERIAL_EXPERIMENTAL));
-
-TEST_P(WindowPositionerTest, OpenMaximizedWindowOnSecondDisplay) {
- const int height_offset = GetMdMaximizedWindowHeightOffset();
+TEST_F(WindowPositionerTest, OpenMaximizedWindowOnSecondDisplay) {
// Tests that for a screen that is narrower than kForceMaximizeWidthLimit
// a new window gets maximized.
UpdateDisplay("400x400,500x500");
@@ -44,11 +35,11 @@ TEST_P(WindowPositionerTest, OpenMaximizedWindowOnSecondDisplay) {
params.can_resize = true;
params.can_maximize = true;
views::Widget* widget = shell::ToplevelWindow::CreateToplevelWindow(params);
- EXPECT_EQ(gfx::Rect(400, 0, 500, 453 + height_offset).ToString(),
+ EXPECT_EQ(gfx::Rect(400, 0, 500, 452).ToString(),
widget->GetWindowBoundsInScreen().ToString());
}
-TEST_P(WindowPositionerTest, OpenDefaultWindowOnSecondDisplay) {
+TEST_F(WindowPositionerTest, OpenDefaultWindowOnSecondDisplay) {
UpdateDisplay("400x400,1400x900");
WmWindow* second_root_window = WmShell::Get()->GetAllRootWindows()[1];
ScopedRootWindowForNewWindows root_for_new_windows(second_root_window);
@@ -66,8 +57,7 @@ TEST_P(WindowPositionerTest, OpenDefaultWindowOnSecondDisplay) {
// Tests that second window inherits first window's maximized state as well as
// its restore bounds.
-TEST_P(WindowPositionerTest, SecondMaximizedWindowHasProperRestoreSize) {
- const int height_offset = GetMdMaximizedWindowHeightOffset();
+TEST_F(WindowPositionerTest, SecondMaximizedWindowHasProperRestoreSize) {
UpdateDisplay("1400x900");
shell::ToplevelWindow::CreateParams params;
params.can_resize = true;
@@ -83,8 +73,7 @@ TEST_P(WindowPositionerTest, SecondMaximizedWindowHasProperRestoreSize) {
// The window should be maximized.
bounds = widget1->GetWindowBoundsInScreen();
EXPECT_TRUE(widget1->IsMaximized());
- EXPECT_EQ(gfx::Rect(0, 0, 1400, 853 + height_offset).ToString(),
- bounds.ToString());
+ EXPECT_EQ(gfx::Rect(0, 0, 1400, 852).ToString(), bounds.ToString());
// Create another window
views::Widget* widget2 = shell::ToplevelWindow::CreateToplevelWindow(params);
@@ -92,8 +81,7 @@ TEST_P(WindowPositionerTest, SecondMaximizedWindowHasProperRestoreSize) {
// The second window should be maximized.
bounds = widget2->GetWindowBoundsInScreen();
EXPECT_TRUE(widget2->IsMaximized());
- EXPECT_EQ(gfx::Rect(0, 0, 1400, 853 + height_offset).ToString(),
- bounds.ToString());
+ EXPECT_EQ(gfx::Rect(0, 0, 1400, 852).ToString(), bounds.ToString());
widget2->Restore();
// Second window's restored size should be set to default size.
@@ -129,7 +117,7 @@ class OutOfDisplayDelegate : public views::WidgetDelegate {
} // namespace
-TEST_P(WindowPositionerTest, EnsureMinimumVisibility) {
+TEST_F(WindowPositionerTest, EnsureMinimumVisibility) {
UpdateDisplay("400x400");
views::Widget* widget = new views::Widget();
views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
@@ -150,7 +138,7 @@ TEST_P(WindowPositionerTest, EnsureMinimumVisibility) {
// resolutions, one can set "ForceMaximizeBrowserWindowOnFirstRun"
// policy. In the following tests we check if the window will be opened in
// maximized mode for low and high resolution when this policy is set.
-TEST_P(WindowPositionerTest, FirstRunMaximizeWindowHighResloution) {
+TEST_F(WindowPositionerTest, FirstRunMaximizeWindowHighResloution) {
const int width = ash::WindowPositioner::GetForceMaximizedWidthLimit() + 100;
// Set resolution to 1466x300.
const std::string resolution = base::IntToString(width) + "x300";
@@ -169,7 +157,7 @@ TEST_P(WindowPositionerTest, FirstRunMaximizeWindowHighResloution) {
}
// For detail see description of FirstRunMaximizeWindowHighResloution.
-TEST_P(WindowPositionerTest, FirstRunMaximizeWindowLowResolution) {
+TEST_F(WindowPositionerTest, FirstRunMaximizeWindowLowResolution) {
const int width = ash::WindowPositioner::GetForceMaximizedWidthLimit() - 100;
// Set resolution to 1266x300.
const std::string resolution = base::IntToString(width) + "x300";
@@ -187,7 +175,7 @@ TEST_P(WindowPositionerTest, FirstRunMaximizeWindowLowResolution) {
EXPECT_EQ(show_state_out, ui::SHOW_STATE_MAXIMIZED);
}
-TEST_P(WindowPositionerTest, IgnoreFullscreenInAutoRearrange) {
+TEST_F(WindowPositionerTest, IgnoreFullscreenInAutoRearrange) {
// Set bigger than 1366 so that the new window is opened in normal state.
UpdateDisplay("1400x800");
« no previous file with comments | « ash/wm/drag_window_resizer_unittest.cc ('k') | ash/wm/window_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698