Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(802)

Unified Diff: components/exo/shell_surface_unittest.cc

Issue 2771663005: Add black background to ARC maximzied window as well as fullscreen. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/exo/shell_surface.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface_unittest.cc
diff --git a/components/exo/shell_surface_unittest.cc b/components/exo/shell_surface_unittest.cc
index 4bdcee0ed56efbfe8864768de6264be2146adbb7..64d69af55c119837b573bc4069127409ee563329 100644
--- a/components/exo/shell_surface_unittest.cc
+++ b/components/exo/shell_surface_unittest.cc
@@ -853,7 +853,7 @@ TEST_F(ShellSurfaceTest, ToggleFullscreen) {
shell_surface->GetWidget()->GetWindowBoundsInScreen().width());
}
-TEST_F(ShellSurfaceTest, ImmersiveFullscreenBackground) {
+TEST_F(ShellSurfaceTest, MaximizedAndImmersiveFullscreenBackground) {
const gfx::Size display_size =
display::Screen::GetScreen()->GetPrimaryDisplay().size();
const gfx::Size buffer_size(display_size);
@@ -876,12 +876,12 @@ TEST_F(ShellSurfaceTest, ImmersiveFullscreenBackground) {
EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().size(),
shell_surface->surface_for_testing()->window()->bounds().size());
- ash::wm::WMEvent event(ash::wm::WM_EVENT_TOGGLE_FULLSCREEN);
+ ash::wm::WMEvent fullscreen_event(ash::wm::WM_EVENT_TOGGLE_FULLSCREEN);
ash::WmWindow* window =
ash::WmWindow::Get(shell_surface->GetWidget()->GetNativeWindow());
// Enter immersive fullscreen mode. Shadow underlay is fullscreen.
- window->GetWindowState()->OnWMEvent(&event);
+ window->GetWindowState()->OnWMEvent(&fullscreen_event);
EXPECT_TRUE(shell_surface->shadow_underlay()->IsVisible());
EXPECT_EQ(1.f, shell_surface->shadow_underlay()->layer()->opacity());
@@ -889,8 +889,23 @@ TEST_F(ShellSurfaceTest, ImmersiveFullscreenBackground) {
shell_surface->shadow_underlay()->bounds().size());
// Leave fullscreen mode. Shadow underlay is restored.
- window->GetWindowState()->OnWMEvent(&event);
+ window->GetWindowState()->OnWMEvent(&fullscreen_event);
+ EXPECT_TRUE(shell_surface->shadow_underlay()->IsVisible());
+ EXPECT_EQ(shadow_bounds, shell_surface->shadow_underlay()->bounds());
+
+ ash::wm::WMEvent maximize_event(ash::wm::WM_EVENT_TOGGLE_MAXIMIZE);
+
+ // Enter maximized mode. Shadow underlay is fullscreen.
+ window->GetWindowState()->OnWMEvent(&maximize_event);
EXPECT_TRUE(shell_surface->shadow_underlay()->IsVisible());
+ EXPECT_EQ(1.f, shell_surface->shadow_underlay()->layer()->opacity());
+ EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().size(),
+ shell_surface->shadow_underlay()->bounds().size());
+
+ // Leave maximized mode. Shadow underlay is fullscreen.
+ window->GetWindowState()->OnWMEvent(&maximize_event);
+ EXPECT_TRUE(shell_surface->shadow_underlay()->IsVisible());
+ EXPECT_EQ(1.f, shell_surface->shadow_underlay()->layer()->opacity());
EXPECT_EQ(shadow_bounds, shell_surface->shadow_underlay()->bounds());
}
« no previous file with comments | « components/exo/shell_surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698