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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 shell_surface->GetWidget()->GetWindowBoundsInScreen().width()); | 119 shell_surface->GetWidget()->GetWindowBoundsInScreen().width()); |
120 } | 120 } |
121 | 121 |
122 TEST_F(ShellSurfaceTest, Minimize) { | 122 TEST_F(ShellSurfaceTest, Minimize) { |
123 gfx::Size buffer_size(256, 256); | 123 gfx::Size buffer_size(256, 256); |
124 std::unique_ptr<Buffer> buffer( | 124 std::unique_ptr<Buffer> buffer( |
125 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); | 125 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); |
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. | |
130 shell_surface->Minimize(); | |
131 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized()); | |
132 | |
133 // Confirm that attaching and commiting doesn't reset the state. | |
129 surface->Attach(buffer.get()); | 134 surface->Attach(buffer.get()); |
130 surface->Commit(); | 135 surface->Commit(); |
reveman
2016/11/22 09:29:11
Would be nice to check that shell surface is still
mtomasz
2016/11/24 00:51:04
Acknowledged.
| |
131 shell_surface->Minimize(); | 136 shell_surface->Minimize(); |
reveman
2016/11/22 09:29:11
Not sure it makes sense to test calling this now t
mtomasz
2016/11/24 00:51:04
Oops, minimizing here completely doesn't make sens
| |
132 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized()); | 137 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized()); |
133 } | 138 } |
134 | 139 |
135 TEST_F(ShellSurfaceTest, Restore) { | 140 TEST_F(ShellSurfaceTest, Restore) { |
136 gfx::Size buffer_size(256, 256); | 141 gfx::Size buffer_size(256, 256); |
137 std::unique_ptr<Buffer> buffer( | 142 std::unique_ptr<Buffer> buffer( |
138 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); | 143 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); |
139 std::unique_ptr<Surface> surface(new Surface); | 144 std::unique_ptr<Surface> surface(new Surface); |
140 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); | 145 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); |
141 | 146 |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
807 shell_surface.OnAccessibilityModeChanged(); | 812 shell_surface.OnAccessibilityModeChanged(); |
808 shell_surface2.OnAccessibilityModeChanged(); | 813 shell_surface2.OnAccessibilityModeChanged(); |
809 | 814 |
810 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); | 815 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); |
811 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); | 816 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); |
812 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); | 817 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); |
813 } | 818 } |
814 | 819 |
815 } // namespace | 820 } // namespace |
816 } // namespace exo | 821 } // namespace exo |
OLD | NEW |