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

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

Issue 2517833003: Allow to create ARC++ windows minimized on startup. (Closed)
Patch Set: Added a test. Created 4 years, 1 month 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 | « components/exo/shell_surface.cc ('k') | 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 surface->Attach(buffer.get()); 129 surface->Attach(buffer.get());
130 surface->Commit(); 130 surface->Commit();
131 shell_surface->Minimize(); 131 shell_surface->Minimize();
132 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized()); 132 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized());
133 } 133 }
134 134
135 TEST_F(ShellSurfaceTest, Minimize_BeforeSurfaceCommit) {
reveman 2016/11/22 08:26:49 nit: s/Minimize_BeforeSurfaceCommit/InitiallyMinim
mtomasz 2016/11/22 08:39:34 Done.
136 gfx::Size buffer_size(256, 256);
137 std::unique_ptr<Buffer> buffer(
reveman 2016/11/22 08:26:48 Can you attach this buffer and commit after callin
mtomasz 2016/11/22 08:39:34 Done.
138 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
139 std::unique_ptr<Surface> surface(new Surface);
140 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
141
142 shell_surface->Minimize();
143 EXPECT_TRUE(shell_surface->GetWidget()->IsMinimized());
144 }
145
135 TEST_F(ShellSurfaceTest, Restore) { 146 TEST_F(ShellSurfaceTest, Restore) {
136 gfx::Size buffer_size(256, 256); 147 gfx::Size buffer_size(256, 256);
137 std::unique_ptr<Buffer> buffer( 148 std::unique_ptr<Buffer> buffer(
138 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); 149 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
139 std::unique_ptr<Surface> surface(new Surface); 150 std::unique_ptr<Surface> surface(new Surface);
140 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); 151 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
141 152
142 surface->Attach(buffer.get()); 153 surface->Attach(buffer.get());
143 surface->Commit(); 154 surface->Commit();
144 // Note: Remove contents to avoid issues with maximize animations in tests. 155 // Note: Remove contents to avoid issues with maximize animations in tests.
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 shell_surface.OnAccessibilityModeChanged(); 818 shell_surface.OnAccessibilityModeChanged();
808 shell_surface2.OnAccessibilityModeChanged(); 819 shell_surface2.OnAccessibilityModeChanged();
809 820
810 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); 821 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible());
811 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); 822 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds());
812 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); 823 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds());
813 } 824 }
814 825
815 } // namespace 826 } // namespace
816 } // namespace exo 827 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/shell_surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698