4785
4785
process(mapper, ARBITRARY_TIME, DEVICE_ID, EV_SYN, SYN_REPORT, 0x00000000);
4788
// Regression test for LP#1238417:
4789
// https://bugs.launchpad.net/mir/+bug/1238417
4791
// Don't assume that ABS_MT_PRESSURE is 0 if you haven't heard from it yet. Instead,
4792
// the pressure axis should be considered as absent.
4793
// If a touch point has always the same positive, non-zero, pressure, that value
4794
// will be informed only once, on its first event. But if mir wasn't running at
4795
// that time, it would consider the pressure to be zero and therefore the point to be
4796
// hovering, which is wrong.
4797
TEST_F(MultiTouchInputMapperTest, Process_IgnorePressureAxisIfValueUnknown) {
4798
MultiTouchInputMapper* mapper = new MultiTouchInputMapper(mDevice);
4799
addConfigurationProperty("touch.deviceType", "touchScreen");
4800
addConfigurationProperty("device.internal", "1");
4801
setDisplayInfoAndReconfigure(DISPLAY_ID, 1024, 768, DISPLAY_ORIENTATION_0);
4802
prepareAxes(POSITION | PRESSURE | ID);
4803
addMapperAndConfigure(mapper);
4805
// Note that there's no ABS_MT_PRESSURE
4806
process(mapper, ARBITRARY_TIME, DEVICE_ID, EV_ABS, ABS_MT_TRACKING_ID, 0x00000018);
4807
process(mapper, ARBITRARY_TIME, DEVICE_ID, EV_ABS, ABS_MT_POSITION_X, 500);
4808
process(mapper, ARBITRARY_TIME, DEVICE_ID, EV_ABS, ABS_MT_POSITION_Y, 300);
4809
process(mapper, ARBITRARY_TIME, DEVICE_ID, EV_SYN, SYN_REPORT, 0x00000000);
4811
NotifyMotionArgs args;
4812
ASSERT_NO_FATAL_FAILURE(mFakeListener->assertNotifyMotionWasCalled(&args));
4814
// Would be AMOTION_EVENT_ACTION_HOVER_ENTER if pressure value was assumed to be 0 (zero),
4815
// which is de default value when the accumulator is cleared.
4816
ASSERT_EQ(AMOTION_EVENT_ACTION_DOWN, args.action);
4788
4819
} // namespace android