Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/aura/wm_window_aura.h" | 5 #include "ash/aura/wm_window_aura.h" |
| 6 #include "ash/common/accessibility_delegate.h" | 6 #include "ash/common/accessibility_delegate.h" |
| 7 #include "ash/common/wm/window_state.h" | 7 #include "ash/common/wm/window_state.h" |
| 8 #include "ash/common/wm/wm_event.h" | 8 #include "ash/common/wm/wm_event.h" |
| 9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 std::unique_ptr<Surface> surface(new Surface); | 126 std::unique_ptr<Surface> surface(new Surface); |
| 127 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); | 127 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| 128 | 128 |
| 129 // Minimizing can be performed before the surface is committed. | 129 // Minimizing can be performed before the surface is committed. |
| 130 shell_surface->Minimize(); | 130 shell_surface->Minimize(); |
| 131 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized()); | 131 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized()); |
| 132 | 132 |
| 133 // Confirm that attaching and commiting doesn't reset the state. | 133 // Confirm that attaching and commiting doesn't reset the state. |
| 134 surface->Attach(buffer.get()); | 134 surface->Attach(buffer.get()); |
| 135 surface->Commit(); | 135 surface->Commit(); |
| 136 shell_surface->Minimize(); | |
| 137 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized()); | 136 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized()); |
| 137 | |
| 138 shell_surface->Restore(); | |
| 139 EXPECT_FALSE(shell_surface->GetWidget()->IsMinimized()); | |
|
reveman
2016/11/25 21:38:54
nit: after this, can you also:
shell_surface->Mini
mtomasz
2016/11/28 09:01:44
Done.
| |
| 138 } | 140 } |
| 139 | 141 |
| 140 TEST_F(ShellSurfaceTest, Restore) { | 142 TEST_F(ShellSurfaceTest, Restore) { |
| 141 gfx::Size buffer_size(256, 256); | 143 gfx::Size buffer_size(256, 256); |
| 142 std::unique_ptr<Buffer> buffer( | 144 std::unique_ptr<Buffer> buffer( |
| 143 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); | 145 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); |
| 144 std::unique_ptr<Surface> surface(new Surface); | 146 std::unique_ptr<Surface> surface(new Surface); |
| 145 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); | 147 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
| 146 | 148 |
| 147 surface->Attach(buffer.get()); | 149 surface->Attach(buffer.get()); |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 812 shell_surface.OnAccessibilityModeChanged(); | 814 shell_surface.OnAccessibilityModeChanged(); |
| 813 shell_surface2.OnAccessibilityModeChanged(); | 815 shell_surface2.OnAccessibilityModeChanged(); |
| 814 | 816 |
| 815 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); | 817 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); |
| 816 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); | 818 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); |
| 817 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); | 819 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); |
| 818 } | 820 } |
| 819 | 821 |
| 820 } // namespace | 822 } // namespace |
| 821 } // namespace exo | 823 } // namespace exo |
| OLD | NEW |