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

Side by Side Diff: components/exo/shell_surface_unittest.cc

Issue 2530443003: Cleanup tests for minimizing ARC++ windows on startup. (Closed)
Patch Set: Updated the test. Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized());
137
138 shell_surface->Restore();
139 EXPECT_FALSE(shell_surface->GetWidget()->IsMinimized());
140
136 shell_surface->Minimize(); 141 shell_surface->Minimize();
137 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized()); 142 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized());
138 } 143 }
139 144
140 TEST_F(ShellSurfaceTest, Restore) { 145 TEST_F(ShellSurfaceTest, Restore) {
141 gfx::Size buffer_size(256, 256); 146 gfx::Size buffer_size(256, 256);
142 std::unique_ptr<Buffer> buffer( 147 std::unique_ptr<Buffer> buffer(
143 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); 148 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
144 std::unique_ptr<Surface> surface(new Surface); 149 std::unique_ptr<Surface> surface(new Surface);
145 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); 150 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 shell_surface.OnAccessibilityModeChanged(); 817 shell_surface.OnAccessibilityModeChanged();
813 shell_surface2.OnAccessibilityModeChanged(); 818 shell_surface2.OnAccessibilityModeChanged();
814 819
815 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); 820 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible());
816 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); 821 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds());
817 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); 822 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds());
818 } 823 }
819 824
820 } // namespace 825 } // namespace
821 } // namespace exo 826 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698