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

Unified Diff: ui/aura/window_tree_host_x11_unittest.cc

Issue 191223007: Move touch CTM from X into Chrome (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add file ui/aura/touch_ctm.h(cc) Created 6 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
« ui/aura/window_tree_host_x11.cc ('K') | « ui/aura/window_tree_host_x11.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_tree_host_x11_unittest.cc
diff --git a/ui/aura/window_tree_host_x11_unittest.cc b/ui/aura/window_tree_host_x11_unittest.cc
index 2fbdd463b2fc1088a9ab809b90e54eb616defd92..bbad80724644dfef93874bece21674955def29d2 100644
--- a/ui/aura/window_tree_host_x11_unittest.cc
+++ b/ui/aura/window_tree_host_x11_unittest.cc
@@ -119,7 +119,8 @@ TEST_F(WindowTreeHostX11Test, DispatchTouchEventToOneRootWindow) {
ui::ScopedXI2Event scoped_xevent;
#if defined(OS_CHROMEOS)
- // This touch is out of bounds.
+ // This touch device does not have TouchCTM stored in the root window.
+ // So touch event is discarded.
scoped_xevent.InitTouchEvent(
0, XI_TouchBegin, 5, gfx::Point(1500, 2500), valuators);
window_tree_host->Dispatch(scoped_xevent);
@@ -128,6 +129,9 @@ TEST_F(WindowTreeHostX11Test, DispatchTouchEventToOneRootWindow) {
EXPECT_EQ(gfx::Point(0, 0), delegate->last_touch_location());
#endif // defined(OS_CHROMEOS)
+ // Make the touchscreen 0 associated with the root window.
+ window_tree_host->SetTouchCTM(0, TouchCTM());
+
// Following touchs are within bounds and are passed to delegate.
scoped_xevent.InitTouchEvent(
0, XI_TouchBegin, 5, gfx::Point(1500, 1500), valuators);
@@ -191,6 +195,9 @@ TEST_F(WindowTreeHostX11Test, DispatchTouchEventToTwoRootWindow) {
EXPECT_EQ(ui::ET_UNKNOWN, delegate2->last_touch_type());
EXPECT_EQ(-1, delegate2->last_touch_id());
+ // Make the touchscreen 0 associated with the second root window.
+ window_tree_host2->SetTouchCTM(0, TouchCTM());
+
// 2 Touch events are targeted at the second WindowTreeHost.
ui::ScopedXI2Event scoped_xevent;
scoped_xevent.InitTouchEvent(
« ui/aura/window_tree_host_x11.cc ('K') | « ui/aura/window_tree_host_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698