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

Unified Diff: ash/wm/window_state_unittest.cc

Issue 2250713006: Allow updating arc widget bounds in maximize/fullscreen state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
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
« no previous file with comments | « ash/common/wm/window_state.h ('k') | components/exo/shell_surface.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 155413b428464fad8c532c36c0ff2c535dede9f9..1a1bf33c1d494ffb4968e091beabfef8aeb84649 100644
--- a/ash/wm/window_state_unittest.cc
+++ b/ash/wm/window_state_unittest.cc
@@ -375,6 +375,39 @@ 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);
+ 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());
+
+ window_state->set_allow_set_bounds_in_maximized(false);
+ window_state->Maximize();
+
+ EXPECT_TRUE(window_state->IsMaximized());
+ EXPECT_EQ(work_area, window->bounds());
+ window->SetBounds(new_bounds);
+ EXPECT_EQ(work_area, window->bounds());
+}
+
// TODO(skuhne): Add more unit test to verify the correctness for the restore
// operation.
« no previous file with comments | « ash/common/wm/window_state.h ('k') | components/exo/shell_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698