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

Side by Side Diff: ash/wm/window_positioner_unittest.cc

Issue 2906803002: Rename MaximizeMode to TabletMode (Closed)
Patch Set: updated filter Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/window_positioner.h" 5 #include "ash/wm/window_positioner.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ash/scoped_root_window_for_new_windows.h" 9 #include "ash/scoped_root_window_for_new_windows.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // Make sure the bounds is adjusted to be inside the work area. 131 // Make sure the bounds is adjusted to be inside the work area.
132 EXPECT_EQ("375,10 100x100", widget->GetWindowBoundsInScreen().ToString()); 132 EXPECT_EQ("375,10 100x100", widget->GetWindowBoundsInScreen().ToString());
133 widget->CloseNow(); 133 widget->CloseNow();
134 } 134 }
135 135
136 // In general case on first run the browser window will be maximized only for 136 // In general case on first run the browser window will be maximized only for
137 // low resolution screens (width < 1366). In case of big screens the browser is 137 // low resolution screens (width < 1366). In case of big screens the browser is
138 // opened being not maximized. To enforce maximization for all screen 138 // opened being not maximized. To enforce maximization for all screen
139 // resolutions, one can set "ForceMaximizeBrowserWindowOnFirstRun" 139 // resolutions, one can set "ForceMaximizeBrowserWindowOnFirstRun"
140 // policy. In the following tests we check if the window will be opened in 140 // policy. In the following tests we check if the window will be opened in
141 // maximized mode for low and high resolution when this policy is set. 141 // tablet mode for low and high resolution when this policy is set.
142 TEST_F(WindowPositionerTest, FirstRunMaximizeWindowHighResloution) { 142 TEST_F(WindowPositionerTest, FirstRunMaximizeWindowHighResloution) {
143 const int width = ash::WindowPositioner::GetForceMaximizedWidthLimit() + 100; 143 const int width = ash::WindowPositioner::GetForceMaximizedWidthLimit() + 100;
144 // Set resolution to 1466x300. 144 // Set resolution to 1466x300.
145 const std::string resolution = base::IntToString(width) + "x300"; 145 const std::string resolution = base::IntToString(width) + "x300";
146 UpdateDisplay(resolution); 146 UpdateDisplay(resolution);
147 gfx::Rect bounds_in_out(0, 0, 320, 240); // Random bounds. 147 gfx::Rect bounds_in_out(0, 0, 320, 240); // Random bounds.
148 ui::WindowShowState show_state_out = ui::SHOW_STATE_DEFAULT; 148 ui::WindowShowState show_state_out = ui::SHOW_STATE_DEFAULT;
149 149
150 test::TestShellDelegate* const delegate = 150 test::TestShellDelegate* const delegate =
151 static_cast<test::TestShellDelegate*>(Shell::Get()->shell_delegate()); 151 static_cast<test::TestShellDelegate*>(Shell::Get()->shell_delegate());
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 widget1->SetFullscreen(false); 203 widget1->SetFullscreen(false);
204 ASSERT_EQ("300x300", widget1->GetWindowBoundsInScreen().size().ToString()); 204 ASSERT_EQ("300x300", widget1->GetWindowBoundsInScreen().size().ToString());
205 205
206 // Closing 2nd widget triggers the rearrange logic but the 1st 206 // Closing 2nd widget triggers the rearrange logic but the 1st
207 // widget should stay in the current size. 207 // widget should stay in the current size.
208 widget2->CloseNow(); 208 widget2->CloseNow();
209 ASSERT_EQ("300x300", widget1->GetWindowBoundsInScreen().size().ToString()); 209 ASSERT_EQ("300x300", widget1->GetWindowBoundsInScreen().size().ToString());
210 } 210 }
211 211
212 } // namespace ash 212 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698