diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-11-02 16:12:05 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-11-06 11:55:51 +1000 |
commit | f827193b6f47a5b21d602949bd5b624e5879513f (patch) | |
tree | 5ce6c0bce76aeb9f9b66eccb499f6f05b1de37c3 | |
parent | 73de3c3b39670e1b65f1c13efa8dfc3df1239b03 (diff) |
server/touch: Add test for Button1Motion mask on emulated pointer motion
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | tests/server/touch.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/server/touch.cpp b/tests/server/touch.cpp index 4ae26d5..cc45a4a 100644 --- a/tests/server/touch.cpp +++ b/tests/server/touch.cpp @@ -199,6 +199,27 @@ TEST_P(TouchTestXI2Version, EmulatedButtonMaskOnTouchBeginEndCore) EXPECT_EQ(ev.xbutton.button, 1U) << "ButtonRelease must have button 1 mask down"; } +TEST_P(TouchTestXI2Version, EmulatedButton1MotionMaskOnTouch) +{ + XORG_TESTCASE("Select for core Pointer1Motion mask on the root window.\n" + "Create a pointer-emulating touch event.\n" + "Expect a motion event with the button mask 1.\n") + + XSelectInput(Display(), DefaultRootWindow(Display()), Button1MotionMask); + XSync(Display(), False); + + dev->Play(RECORDINGS_DIR "tablets/N-Trig-MultiTouch.touch_1_begin.events"); + dev->Play(RECORDINGS_DIR "tablets/N-Trig-MultiTouch.touch_1_end.events"); + + ASSERT_TRUE(xorg::testing::XServer::WaitForEventOfType(Display(), + MotionNotify, + -1, -1)); + XEvent ev; + XNextEvent(Display(), &ev); + ASSERT_EQ(ev.type, MotionNotify); + EXPECT_EQ(ev.xmotion.state, (unsigned int)Button1Mask); +} + TEST_P(TouchTestXI2Version, EmulatedButtonMaskOnTouchBeginEndXI2) { XORG_TESTCASE("Select for XI_Motion and XI_ButtonPress/Release events on the root window.\n" |