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

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

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