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

Unified Diff: ash/wm/window_state_unittest.cc

Issue 2237983002: Allow updating arc widget bounds in maximize/fullscreen state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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
Index: ash/wm/window_state_unittest.cc
diff --git a/ash/wm/window_state_unittest.cc b/ash/wm/window_state_unittest.cc
index 155413b428464fad8c532c36c0ff2c535dede9f9..76e9045e425990fc4794763ac0ae82cc9294a9bb 100644
--- a/ash/wm/window_state_unittest.cc
+++ b/ash/wm/window_state_unittest.cc
@@ -375,6 +375,31 @@ TEST_P(WindowStateTest, DoNotResizeMaximizedWindowInFullscreen) {
maximized->GetBoundsInScreen().ToString());
}
+TEST_P(WindowStateTest, AllowSetBoundsInMaximized) {
+ std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
+ WindowState* window_state = GetWindowState(window.get());
+ EXPECT_FALSE(window_state->IsMaximized());
+ gfx::Rect work_area =
+ display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
+ gfx::Rect original_bounds(50, 50, 200, 200);
+ window->SetBounds(original_bounds);
+ ASSERT_EQ(original_bounds, window->bounds());
+
+ window_state->set_allow_set_bounds_in_maximized(true);
reveman 2016/08/11 19:07:25 can you test that restoring it to false after this
+ window_state->Maximize();
+
+ EXPECT_TRUE(window_state->IsMaximized());
+ EXPECT_EQ(work_area, window->bounds());
+
+ gfx::Rect new_bounds(10, 10, 300, 300);
+ window->SetBounds(new_bounds);
+ EXPECT_EQ(new_bounds, window->bounds());
+
+ window_state->Restore();
+ EXPECT_FALSE(window_state->IsMaximized());
+ EXPECT_EQ(original_bounds, window->bounds());
+}
+
// TODO(skuhne): Add more unit test to verify the correctness for the restore
// operation.

Powered by Google App Engine
This is Rietveld 408576698