| 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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 | 822 |
| 823 // Sending a shadow bounds in maximized state won't create a shaodw. | 823 // Sending a shadow bounds in maximized state won't create a shaodw. |
| 824 shell_surface->SetRectangularSurfaceShadow(gfx::Rect(10, 10, 100, 100)); | 824 shell_surface->SetRectangularSurfaceShadow(gfx::Rect(10, 10, 100, 100)); |
| 825 surface->Commit(); | 825 surface->Commit(); |
| 826 | 826 |
| 827 EXPECT_FALSE(wm::ShadowController::GetShadowForWindow(window)); | 827 EXPECT_FALSE(wm::ShadowController::GetShadowForWindow(window)); |
| 828 // Underlay should be created even without shadow. | 828 // Underlay should be created even without shadow. |
| 829 ASSERT_TRUE(shell_surface->shadow_underlay()); | 829 ASSERT_TRUE(shell_surface->shadow_underlay()); |
| 830 EXPECT_TRUE(shell_surface->shadow_underlay()->IsVisible()); | 830 EXPECT_TRUE(shell_surface->shadow_underlay()->IsVisible()); |
| 831 | 831 |
| 832 shell_surface->SetRectangularSurfaceShadow(gfx::Rect(0, 0, 0, 0)); | |
| 833 // Underlay should be created even without shadow. | |
| 834 ASSERT_TRUE(shell_surface->shadow_underlay()); | |
| 835 EXPECT_TRUE(shell_surface->shadow_underlay()->IsVisible()); | |
| 836 shell_surface->SetRectangularShadowEnabled(false); | |
| 837 surface->Commit(); | |
| 838 // Underlay should be created even without shadow. | |
| 839 ASSERT_TRUE(shell_surface->shadow_underlay()); | |
| 840 EXPECT_TRUE(shell_surface->shadow_underlay()->IsVisible()); | |
| 841 | |
| 842 shell_surface->SetRectangularShadowEnabled(true); | |
| 843 shell_surface->SetRectangularSurfaceShadow(gfx::Rect(10, 10, 100, 100)); | |
| 844 surface->Commit(); | |
| 845 | |
| 846 // Restore the window and make sure the shadow is created, visible and | 832 // Restore the window and make sure the shadow is created, visible and |
| 847 // has the latest bounds. | 833 // has the latest bounds. |
| 848 widget->Restore(); | 834 widget->Restore(); |
| 849 wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window); | 835 wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window); |
| 850 ASSERT_TRUE(shadow); | 836 ASSERT_TRUE(shadow); |
| 851 EXPECT_TRUE(shadow->layer()->visible()); | 837 EXPECT_TRUE(shadow->layer()->visible()); |
| 852 EXPECT_EQ(gfx::Rect(10, 10, 100, 100), shadow->layer()->parent()->bounds()); | 838 EXPECT_EQ(gfx::Rect(10, 10, 100, 100), shadow->layer()->parent()->bounds()); |
| 853 } | 839 } |
| 854 | 840 |
| 855 TEST_F(ShellSurfaceTest, ToggleFullscreen) { | 841 TEST_F(ShellSurfaceTest, ToggleFullscreen) { |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 shell_surface.OnAccessibilityModeChanged(); | 1006 shell_surface.OnAccessibilityModeChanged(); |
| 1021 shell_surface2.OnAccessibilityModeChanged(); | 1007 shell_surface2.OnAccessibilityModeChanged(); |
| 1022 | 1008 |
| 1023 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); | 1009 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); |
| 1024 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); | 1010 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); |
| 1025 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); | 1011 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); |
| 1026 } | 1012 } |
| 1027 | 1013 |
| 1028 } // namespace | 1014 } // namespace |
| 1029 } // namespace exo | 1015 } // namespace exo |
| OLD | NEW |