Chromium Code Reviews| 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. |