| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |