| Index: ash/wm/window_state_unittest.cc
|
| diff --git a/ash/wm/window_state_unittest.cc b/ash/wm/window_state_unittest.cc
|
| index 6431f4fae76a03ece7f67b021aa94d54e3a3ffd1..c5eff758c597a560c5a9d352535eed8036fc4b86 100644
|
| --- a/ash/wm/window_state_unittest.cc
|
| +++ b/ash/wm/window_state_unittest.cc
|
| @@ -8,6 +8,7 @@
|
|
|
| #include "ash/common/material_design/material_design_controller.h"
|
| #include "ash/common/wm/window_state.h"
|
| +#include "ash/common/wm/window_state_util.h"
|
| #include "ash/common/wm/wm_event.h"
|
| #include "ash/test/ash_md_test_base.h"
|
| #include "ash/wm/window_state_aura.h"
|
| @@ -421,6 +422,56 @@ TEST_P(WindowStateTest, AllowSetBoundsInMaximized) {
|
| EXPECT_EQ(work_area, window->bounds());
|
| }
|
|
|
| +TEST_P(WindowStateTest, FullscreenMinimizedSwitching) {
|
| + std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithId(0));
|
| + WindowState* window_state = GetWindowState(window.get());
|
| +
|
| + ash::wm::ToggleFullScreen(window_state, nullptr);
|
| + ASSERT_TRUE(window_state->IsFullscreen());
|
| +
|
| + // Toggling the fullscreen window should restore to normal.
|
| + ash::wm::ToggleFullScreen(window_state, nullptr);
|
| + ASSERT_TRUE(window_state->IsNormalStateType());
|
| +
|
| + window_state->Maximize();
|
| + ASSERT_TRUE(window_state->IsMaximized());
|
| +
|
| + ash::wm::ToggleFullScreen(window_state, nullptr);
|
| + ASSERT_TRUE(window_state->IsFullscreen());
|
| +
|
| + // Toggling the fullscreen window should restore to maximized.
|
| + ash::wm::ToggleFullScreen(window_state, nullptr);
|
| + ASSERT_TRUE(window_state->IsMaximized());
|
| +
|
| + ash::wm::ToggleFullScreen(window_state, nullptr);
|
| + ASSERT_TRUE(window_state->IsFullscreen());
|
| +
|
| + // Minimize from fullscreen.
|
| + window_state->Minimize();
|
| + ASSERT_TRUE(window_state->IsMinimized());
|
| +
|
| + // Unminimize should restore to fullscreen.
|
| + window_state->Unminimize();
|
| + ASSERT_TRUE(window_state->IsFullscreen());
|
| +
|
| + // Toggling the fullscreen window should restore to maximized.
|
| + ash::wm::ToggleFullScreen(window_state, nullptr);
|
| + ASSERT_TRUE(window_state->IsMaximized());
|
| +
|
| + // Minimize from fullscreen.
|
| + window_state->Minimize();
|
| + ASSERT_TRUE(window_state->IsMinimized());
|
| +
|
| + // Fullscreen a minimized window.
|
| + ash::wm::ToggleFullScreen(window_state, nullptr);
|
| + ASSERT_TRUE(window_state->IsFullscreen());
|
| +
|
| + // Toggling the fullscreen window should not return to minimized. It should
|
| + // return to the state before minimizing and fullscreen.
|
| + ash::wm::ToggleFullScreen(window_state, nullptr);
|
| + ASSERT_TRUE(window_state->IsMaximized());
|
| +}
|
| +
|
| // TODO(skuhne): Add more unit test to verify the correctness for the restore
|
| // operation.
|
|
|
|
|