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

Unified Diff: components/exo/pointer_unittest.cc

Issue 1641773004: exo: Fix sub surface input event support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | components/exo/surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/pointer_unittest.cc
diff --git a/components/exo/pointer_unittest.cc b/components/exo/pointer_unittest.cc
index 8569dd509fed70238f937461a718cad9a6cd0a44..b928feb29128da8cf722f78174e1bd3a6c9712e0 100644
--- a/components/exo/pointer_unittest.cc
+++ b/components/exo/pointer_unittest.cc
@@ -106,6 +106,27 @@ TEST_F(PointerTest, OnPointerMotion) {
generator.MoveMouseTo(surface->GetBoundsInScreen().origin() +
gfx::Vector2d(1, 1));
+ scoped_ptr<Surface> sub_surface(new Surface);
+ surface->AddSubSurface(sub_surface.get());
+ surface->SetSubSurfacePosition(sub_surface.get(), gfx::Point(5, 5));
+ gfx::Size sub_buffer_size(5, 5);
+ scoped_ptr<Buffer> sub_buffer(
+ new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(sub_buffer_size),
+ GL_TEXTURE_2D));
+ sub_surface->Attach(sub_buffer.get());
+ sub_surface->Commit();
+ surface->Commit();
+
+ EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(sub_surface.get()))
+ .WillRepeatedly(testing::Return(true));
+ EXPECT_CALL(delegate, OnPointerLeave(surface.get()));
+ EXPECT_CALL(delegate, OnPointerEnter(sub_surface.get(), gfx::Point(), 0));
+ generator.MoveMouseTo(sub_surface->GetBoundsInScreen().origin());
+
+ EXPECT_CALL(delegate, OnPointerMotion(testing::_, gfx::Point(1, 1)));
+ generator.MoveMouseTo(sub_surface->GetBoundsInScreen().origin() +
+ gfx::Vector2d(1, 1));
+
EXPECT_CALL(delegate, OnPointerDestroying(pointer.get()));
pointer.reset();
}
« no previous file with comments | « no previous file | components/exo/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698