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

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

Issue 2782223002: Add ability to have active window autohide shelf (Closed)
Patch Set: Rebase Created 3 years, 8 months 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 "components/exo/shell_surface.h" 5 #include "components/exo/shell_surface.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/common/wm_window.h" 10 #include "ash/common/wm_window.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 EXPECT_TRUE( 200 EXPECT_TRUE(
201 ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow()) 201 ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow())
202 ->IsPinned()); 202 ->IsPinned());
203 203
204 shell_surface->SetPinned(false, /* trusted */ false); 204 shell_surface->SetPinned(false, /* trusted */ false);
205 EXPECT_FALSE( 205 EXPECT_FALSE(
206 ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow()) 206 ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow())
207 ->IsPinned()); 207 ->IsPinned());
208 } 208 }
209 209
210 TEST_F(ShellSurfaceTest, SetSystemUiVisibility) {
211 gfx::Size buffer_size(256, 256);
212 std::unique_ptr<Buffer> buffer(
213 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
214 std::unique_ptr<Surface> surface(new Surface);
215 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
216 surface->Attach(buffer.get());
217 surface->Commit();
218
219 shell_surface->SetSystemUiVisibility(true);
220 EXPECT_TRUE(
221 ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow())
222 ->autohide_shelf_when_maximized_or_fullscreen());
223
224 shell_surface->SetSystemUiVisibility(false);
225 EXPECT_FALSE(
226 ash::wm::GetWindowState(shell_surface->GetWidget()->GetNativeWindow())
227 ->autohide_shelf_when_maximized_or_fullscreen());
228 }
229
210 TEST_F(ShellSurfaceTest, SetTitle) { 230 TEST_F(ShellSurfaceTest, SetTitle) {
211 std::unique_ptr<Surface> surface(new Surface); 231 std::unique_ptr<Surface> surface(new Surface);
212 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); 232 std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
213 233
214 shell_surface->SetTitle(base::string16(base::ASCIIToUTF16("test"))); 234 shell_surface->SetTitle(base::string16(base::ASCIIToUTF16("test")));
215 surface->Commit(); 235 surface->Commit();
216 } 236 }
217 237
218 TEST_F(ShellSurfaceTest, SetApplicationId) { 238 TEST_F(ShellSurfaceTest, SetApplicationId) {
219 gfx::Size buffer_size(64, 64); 239 gfx::Size buffer_size(64, 64);
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 shell_surface.OnAccessibilityModeChanged(); 1007 shell_surface.OnAccessibilityModeChanged();
988 shell_surface2.OnAccessibilityModeChanged(); 1008 shell_surface2.OnAccessibilityModeChanged();
989 1009
990 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); 1010 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible());
991 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); 1011 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds());
992 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); 1012 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds());
993 } 1013 }
994 1014
995 } // namespace 1015 } // namespace
996 } // namespace exo 1016 } // 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