| 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" | |
| 6 #include "ash/common/accessibility_delegate.h" | 5 #include "ash/common/accessibility_delegate.h" |
| 7 #include "ash/common/wm/window_state.h" | 6 #include "ash/common/wm/window_state.h" |
| 8 #include "ash/common/wm/wm_event.h" | 7 #include "ash/common/wm/wm_event.h" |
| 9 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.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" |
| 11 #include "ash/wm/window_state_aura.h" | 11 #include "ash/wm/window_state_aura.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "components/exo/buffer.h" | 14 #include "components/exo/buffer.h" |
| 15 #include "components/exo/display.h" | 15 #include "components/exo/display.h" |
| 16 #include "components/exo/shell_surface.h" | 16 #include "components/exo/shell_surface.h" |
| 17 #include "components/exo/sub_surface.h" | 17 #include "components/exo/sub_surface.h" |
| 18 #include "components/exo/surface.h" | 18 #include "components/exo/surface.h" |
| 19 #include "components/exo/test/exo_test_base.h" | 19 #include "components/exo/test/exo_test_base.h" |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 EXPECT_EQ( | 693 EXPECT_EQ( |
| 694 buffer_size.ToString(), | 694 buffer_size.ToString(), |
| 695 shell_surface->GetWidget()->GetWindowBoundsInScreen().size().ToString()); | 695 shell_surface->GetWidget()->GetWindowBoundsInScreen().size().ToString()); |
| 696 | 696 |
| 697 shell_surface->Maximize(); | 697 shell_surface->Maximize(); |
| 698 EXPECT_EQ(CurrentContext()->bounds().width(), | 698 EXPECT_EQ(CurrentContext()->bounds().width(), |
| 699 shell_surface->GetWidget()->GetWindowBoundsInScreen().width()); | 699 shell_surface->GetWidget()->GetWindowBoundsInScreen().width()); |
| 700 | 700 |
| 701 ash::wm::WMEvent event(ash::wm::WM_EVENT_TOGGLE_FULLSCREEN); | 701 ash::wm::WMEvent event(ash::wm::WM_EVENT_TOGGLE_FULLSCREEN); |
| 702 ash::WmWindow* window = | 702 ash::WmWindow* window = |
| 703 ash::WmWindowAura::Get(shell_surface->GetWidget()->GetNativeWindow()); | 703 ash::WmWindow::Get(shell_surface->GetWidget()->GetNativeWindow()); |
| 704 | 704 |
| 705 // Enter fullscreen mode. | 705 // Enter fullscreen mode. |
| 706 window->GetWindowState()->OnWMEvent(&event); | 706 window->GetWindowState()->OnWMEvent(&event); |
| 707 | 707 |
| 708 EXPECT_EQ(CurrentContext()->bounds().ToString(), | 708 EXPECT_EQ(CurrentContext()->bounds().ToString(), |
| 709 shell_surface->GetWidget()->GetWindowBoundsInScreen().ToString()); | 709 shell_surface->GetWidget()->GetWindowBoundsInScreen().ToString()); |
| 710 | 710 |
| 711 // Leave fullscreen mode. | 711 // Leave fullscreen mode. |
| 712 window->GetWindowState()->OnWMEvent(&event); | 712 window->GetWindowState()->OnWMEvent(&event); |
| 713 | 713 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 728 surface->Attach(buffer.get()); | 728 surface->Attach(buffer.get()); |
| 729 | 729 |
| 730 gfx::Rect shadow_bounds(10, 10, 100, 100); | 730 gfx::Rect shadow_bounds(10, 10, 100, 100); |
| 731 shell_surface->SetRectangularShadow(true); | 731 shell_surface->SetRectangularShadow(true); |
| 732 shell_surface->SetRectangularShadowContentBounds(shadow_bounds); | 732 shell_surface->SetRectangularShadowContentBounds(shadow_bounds); |
| 733 surface->Commit(); | 733 surface->Commit(); |
| 734 ASSERT_EQ(shadow_bounds, shell_surface->shadow_underlay()->bounds()); | 734 ASSERT_EQ(shadow_bounds, shell_surface->shadow_underlay()->bounds()); |
| 735 | 735 |
| 736 ash::wm::WMEvent event(ash::wm::WM_EVENT_TOGGLE_FULLSCREEN); | 736 ash::wm::WMEvent event(ash::wm::WM_EVENT_TOGGLE_FULLSCREEN); |
| 737 ash::WmWindow* window = | 737 ash::WmWindow* window = |
| 738 ash::WmWindowAura::Get(shell_surface->GetWidget()->GetNativeWindow()); | 738 ash::WmWindow::Get(shell_surface->GetWidget()->GetNativeWindow()); |
| 739 | 739 |
| 740 // Enter immersive fullscreen mode. Shadow underlay is fullscreen. | 740 // Enter immersive fullscreen mode. Shadow underlay is fullscreen. |
| 741 window->GetWindowState()->OnWMEvent(&event); | 741 window->GetWindowState()->OnWMEvent(&event); |
| 742 | 742 |
| 743 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(), | 743 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(), |
| 744 shell_surface->shadow_underlay()->bounds()); | 744 shell_surface->shadow_underlay()->bounds()); |
| 745 EXPECT_TRUE(shell_surface->shadow_underlay()->IsVisible()); | 745 EXPECT_TRUE(shell_surface->shadow_underlay()->IsVisible()); |
| 746 EXPECT_EQ(1.f, shell_surface->shadow_underlay()->layer()->opacity()); | 746 EXPECT_EQ(1.f, shell_surface->shadow_underlay()->layer()->opacity()); |
| 747 EXPECT_NE(shell_surface->GetWidget()->GetWindowBoundsInScreen(), | 747 EXPECT_NE(shell_surface->GetWidget()->GetWindowBoundsInScreen(), |
| 748 shell_surface->shadow_underlay()->bounds()); | 748 shell_surface->shadow_underlay()->bounds()); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 shell_surface.OnAccessibilityModeChanged(); | 824 shell_surface.OnAccessibilityModeChanged(); |
| 825 shell_surface2.OnAccessibilityModeChanged(); | 825 shell_surface2.OnAccessibilityModeChanged(); |
| 826 | 826 |
| 827 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); | 827 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); |
| 828 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); | 828 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); |
| 829 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); | 829 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); |
| 830 } | 830 } |
| 831 | 831 |
| 832 } // namespace | 832 } // namespace |
| 833 } // namespace exo | 833 } // namespace exo |
| OLD | NEW |