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

Unified Diff: components/exo/shell_surface_unittest.cc

Issue 2255313005: Use MD-ash's auto hide behavior for arc++ windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: . Created 4 years, 4 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 f8e88ec1eadd3fa0f46a6d17ae3bf30619840703..cfeffaaeec4239882414c3bd42dd905b85d0cb46 100644
--- a/components/exo/shell_surface_unittest.cc
+++ b/components/exo/shell_surface_unittest.cc
@@ -647,5 +647,41 @@ TEST_F(ShellSurfaceTest, ToggleFullscreen) {
shell_surface->GetWidget()->GetWindowBoundsInScreen().width());
}
+TEST_F(ShellSurfaceTest, ImmersiveFullscreenBackground) {
+ gfx::Size buffer_size(256, 256);
+ std::unique_ptr<Buffer> buffer(
+ new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
+ std::unique_ptr<Surface> surface(new Surface);
+ std::unique_ptr<ShellSurface> shell_surface(
+ new ShellSurface(surface.get(), nullptr, gfx::Rect(640, 480), true,
+ ash::kShellWindowId_DefaultContainer));
+
+ surface->Attach(buffer.get());
+
+ gfx::Rect shadow_bounds(10, 10, 100, 100);
+ shell_surface->SetRectangularShadow(shadow_bounds);
+ surface->Commit();
+ ASSERT_EQ(shadow_bounds, shell_surface->shadow_underlay_for_test()->bounds());
+
+ ash::wm::WMEvent event(ash::wm::WM_EVENT_TOGGLE_FULLSCREEN);
+ ash::WmWindow* window =
+ ash::WmWindowAura::Get(shell_surface->GetWidget()->GetNativeWindow());
+
+ // Enter immersive fullscreen mode. Shadow underlay is fullscreen.
+ window->GetWindowState()->OnWMEvent(&event);
+
+ EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(),
+ shell_surface->shadow_underlay_for_test()->bounds());
+ EXPECT_TRUE(shell_surface->shadow_underlay_for_test()->IsVisible());
+ EXPECT_EQ(1.f, shell_surface->shadow_underlay_for_test()->layer()->opacity());
+ EXPECT_NE(shell_surface->GetWidget()->GetWindowBoundsInScreen(),
+ shell_surface->shadow_underlay_for_test()->bounds());
+
+ // Leave fullscreen mode. Shadow underlay is restored.
+ window->GetWindowState()->OnWMEvent(&event);
+ EXPECT_TRUE(shell_surface->shadow_underlay_for_test()->IsVisible());
+ EXPECT_EQ(shadow_bounds, shell_surface->shadow_underlay_for_test()->bounds());
+}
+
} // namespace
} // namespace exo
« 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