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