| 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/aura/wm_window_aura.h" | 5 #include "ash/aura/wm_window_aura.h" |
| 6 #include "ash/common/shell_window_ids.h" | 6 #include "ash/common/shell_window_ids.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/wm/window_state_aura.h" | 10 #include "ash/wm/window_state_aura.h" |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 aura::Window* window = widget->GetNativeWindow(); | 592 aura::Window* window = widget->GetNativeWindow(); |
| 593 | 593 |
| 594 // There is no shadow when started in maximized state. | 594 // There is no shadow when started in maximized state. |
| 595 EXPECT_FALSE(wm::ShadowController::GetShadowForWindow(window)); | 595 EXPECT_FALSE(wm::ShadowController::GetShadowForWindow(window)); |
| 596 | 596 |
| 597 // Sending a shadow bounds in maximized state won't create a shaodw. | 597 // Sending a shadow bounds in maximized state won't create a shaodw. |
| 598 shell_surface->SetRectangularShadow(gfx::Rect(10, 10, 100, 100)); | 598 shell_surface->SetRectangularShadow(gfx::Rect(10, 10, 100, 100)); |
| 599 surface->Commit(); | 599 surface->Commit(); |
| 600 | 600 |
| 601 EXPECT_FALSE(wm::ShadowController::GetShadowForWindow(window)); | 601 EXPECT_FALSE(wm::ShadowController::GetShadowForWindow(window)); |
| 602 // Underlay should be created even without shadow. |
| 603 ASSERT_TRUE(shell_surface->shadow_underlay_for_test()); |
| 604 EXPECT_TRUE(shell_surface->shadow_underlay_for_test()->IsVisible()); |
| 602 | 605 |
| 603 // Restore the window and make sure the shadow is created, visible and | 606 // Restore the window and make sure the shadow is created, visible and |
| 604 // has the latest bounds. | 607 // has the latest bounds. |
| 605 widget->Restore(); | 608 widget->Restore(); |
| 606 wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window); | 609 wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window); |
| 607 ASSERT_TRUE(shadow); | 610 ASSERT_TRUE(shadow); |
| 608 EXPECT_TRUE(shadow->layer()->visible()); | 611 EXPECT_TRUE(shadow->layer()->visible()); |
| 609 EXPECT_EQ(gfx::Rect(10, 10, 100, 100), shadow->layer()->parent()->bounds()); | 612 EXPECT_EQ(gfx::Rect(10, 10, 100, 100), shadow->layer()->parent()->bounds()); |
| 610 } | 613 } |
| 611 | 614 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 639 // Leave fullscreen mode. | 642 // Leave fullscreen mode. |
| 640 window->GetWindowState()->OnWMEvent(&event); | 643 window->GetWindowState()->OnWMEvent(&event); |
| 641 | 644 |
| 642 // Check that shell surface is maximized. | 645 // Check that shell surface is maximized. |
| 643 EXPECT_EQ(CurrentContext()->bounds().width(), | 646 EXPECT_EQ(CurrentContext()->bounds().width(), |
| 644 shell_surface->GetWidget()->GetWindowBoundsInScreen().width()); | 647 shell_surface->GetWidget()->GetWindowBoundsInScreen().width()); |
| 645 } | 648 } |
| 646 | 649 |
| 647 } // namespace | 650 } // namespace |
| 648 } // namespace exo | 651 } // namespace exo |
| OLD | NEW |