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

Unified Diff: components/exo/shell_surface_unittest.cc

Issue 1492803004: exo: Add SetGeometry function to ShellSurface class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@exosphere-xdg-shell
Patch Set: implement xdg_surface_set_window_geometry Created 5 years 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') | components/exo/wayland/server.cc » ('j') | 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 0f25a734950feb14822e2620f47ea5597106b02f..c8b6d467eec75a10111c601282f932268408652b 100644
--- a/components/exo/shell_surface_unittest.cc
+++ b/components/exo/shell_surface_unittest.cc
@@ -117,5 +117,25 @@ TEST_F(ShellSurfaceTest, Move) {
shell_surface->Move();
}
+TEST_F(ShellSurfaceTest, SetGeometry) {
+ gfx::Size buffer_size(64, 64);
+ scoped_ptr<Buffer> buffer(new Buffer(
+ exo_test_helper()->CreateGpuMemoryBuffer(buffer_size), GL_TEXTURE_2D));
+ scoped_ptr<Surface> surface(new Surface);
+ scoped_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get()));
+
+ shell_surface->SetToplevel();
+ gfx::Rect geometry(16, 16, 32, 32);
+ shell_surface->SetGeometry(geometry);
+ surface->Attach(buffer.get());
+ surface->Commit();
+ EXPECT_EQ(
+ geometry.size().ToString(),
+ shell_surface->GetWidget()->GetWindowBoundsInScreen().size().ToString());
+ EXPECT_EQ(gfx::Rect(gfx::Point() - geometry.OffsetFromOrigin(), buffer_size)
+ .ToString(),
+ surface->bounds().ToString());
+}
+
} // namespace
} // namespace exo
« no previous file with comments | « components/exo/shell_surface.cc ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698