@@ -7364,43 +7364,47 @@ TEST_F(MultiTouchInputMapperTest, Process_WhenBtnTouchPresent_HoversIfItsValueIs
73647364 toDisplayX (150 ), toDisplayY (250 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
73657365
73667366 // down when BTN_TOUCH is pressed, pressure defaults to 1
7367+ processPosition (mapper, 151 , 251 );
73677368 processKey (mapper, BTN_TOUCH, 1 );
73687369 processSync (mapper);
73697370 ASSERT_NO_FATAL_FAILURE (mFakeListener ->assertNotifyMotionWasCalled (&motionArgs));
73707371 ASSERT_EQ (AMOTION_EVENT_ACTION_HOVER_EXIT, motionArgs.action );
7372+ // HOVER_EXIT should have the same coordinates as the previous HOVER_MOVE
73717373 ASSERT_NO_FATAL_FAILURE (assertPointerCoords (motionArgs.pointerCoords [0 ],
73727374 toDisplayX (150 ), toDisplayY (250 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7373-
7375+ // down at the new position
73747376 ASSERT_NO_FATAL_FAILURE (mFakeListener ->assertNotifyMotionWasCalled (&motionArgs));
73757377 ASSERT_EQ (AMOTION_EVENT_ACTION_DOWN, motionArgs.action );
73767378 ASSERT_NO_FATAL_FAILURE (assertPointerCoords (motionArgs.pointerCoords [0 ],
7377- toDisplayX (150 ), toDisplayY (250 ), 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7379+ toDisplayX (151 ), toDisplayY (251 ), 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
73787380
73797381 // up when BTN_TOUCH is released, hover restored
7382+ processPosition (mapper, 152 , 252 );
73807383 processKey (mapper, BTN_TOUCH, 0 );
73817384 processSync (mapper);
73827385 ASSERT_NO_FATAL_FAILURE (mFakeListener ->assertNotifyMotionWasCalled (&motionArgs));
73837386 ASSERT_EQ (AMOTION_EVENT_ACTION_UP, motionArgs.action );
7387+ // UP should have the same coordinates as the previous event
73847388 ASSERT_NO_FATAL_FAILURE (assertPointerCoords (motionArgs.pointerCoords [0 ],
7385- toDisplayX (150 ), toDisplayY (250 ), 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7386-
7389+ toDisplayX (151 ), toDisplayY (251 ), 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7390+ // HOVER_ENTER at the new position
73877391 ASSERT_NO_FATAL_FAILURE (mFakeListener ->assertNotifyMotionWasCalled (&motionArgs));
73887392 ASSERT_EQ (AMOTION_EVENT_ACTION_HOVER_ENTER, motionArgs.action );
73897393 ASSERT_NO_FATAL_FAILURE (assertPointerCoords (motionArgs.pointerCoords [0 ],
7390- toDisplayX (150 ), toDisplayY (250 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7394+ toDisplayX (152 ), toDisplayY (252 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
73917395
73927396 ASSERT_NO_FATAL_FAILURE (mFakeListener ->assertNotifyMotionWasCalled (&motionArgs));
73937397 ASSERT_EQ (AMOTION_EVENT_ACTION_HOVER_MOVE, motionArgs.action );
73947398 ASSERT_NO_FATAL_FAILURE (assertPointerCoords (motionArgs.pointerCoords [0 ],
7395- toDisplayX (150 ), toDisplayY (250 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7399+ toDisplayX (152 ), toDisplayY (252 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
73967400
73977401 // exit hover when pointer goes away
73987402 processId (mapper, -1 );
73997403 processSync (mapper);
74007404 ASSERT_NO_FATAL_FAILURE (mFakeListener ->assertNotifyMotionWasCalled (&motionArgs));
74017405 ASSERT_EQ (AMOTION_EVENT_ACTION_HOVER_EXIT, motionArgs.action );
74027406 ASSERT_NO_FATAL_FAILURE (assertPointerCoords (motionArgs.pointerCoords [0 ],
7403- toDisplayX (150 ), toDisplayY (250 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7407+ toDisplayX (152 ), toDisplayY (252 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
74047408}
74057409
74067410TEST_F (MultiTouchInputMapperTest, Process_WhenAbsMTPressureIsPresent_HoversIfItsValueIsZero) {
@@ -7435,43 +7439,47 @@ TEST_F(MultiTouchInputMapperTest, Process_WhenAbsMTPressureIsPresent_HoversIfIts
74357439 toDisplayX (150 ), toDisplayY (250 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
74367440
74377441 // down when pressure becomes non-zero
7442+ processPosition (mapper, 151 , 251 );
74387443 processPressure (mapper, RAW_PRESSURE_MAX);
74397444 processSync (mapper);
74407445 ASSERT_NO_FATAL_FAILURE (mFakeListener ->assertNotifyMotionWasCalled (&motionArgs));
74417446 ASSERT_EQ (AMOTION_EVENT_ACTION_HOVER_EXIT, motionArgs.action );
7447+ // HOVER_EXIT should have the same coordinates as the previous HOVER_MOVE
74427448 ASSERT_NO_FATAL_FAILURE (assertPointerCoords (motionArgs.pointerCoords [0 ],
74437449 toDisplayX (150 ), toDisplayY (250 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7444-
7450+ // down at the new position
74457451 ASSERT_NO_FATAL_FAILURE (mFakeListener ->assertNotifyMotionWasCalled (&motionArgs));
74467452 ASSERT_EQ (AMOTION_EVENT_ACTION_DOWN, motionArgs.action );
74477453 ASSERT_NO_FATAL_FAILURE (assertPointerCoords (motionArgs.pointerCoords [0 ],
7448- toDisplayX (150 ), toDisplayY (250 ), 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7454+ toDisplayX (151 ), toDisplayY (251 ), 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
74497455
74507456 // up when pressure becomes 0, hover restored
7457+ processPosition (mapper, 152 , 252 );
74517458 processPressure (mapper, 0 );
74527459 processSync (mapper);
74537460 ASSERT_NO_FATAL_FAILURE (mFakeListener ->assertNotifyMotionWasCalled (&motionArgs));
74547461 ASSERT_EQ (AMOTION_EVENT_ACTION_UP, motionArgs.action );
7462+ // UP should have the same coordinates as the previous event
74557463 ASSERT_NO_FATAL_FAILURE (assertPointerCoords (motionArgs.pointerCoords [0 ],
7456- toDisplayX (150 ), toDisplayY (250 ), 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7457-
7464+ toDisplayX (151 ), toDisplayY (251 ), 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7465+ // HOVER_ENTER at the new position
74587466 ASSERT_NO_FATAL_FAILURE (mFakeListener ->assertNotifyMotionWasCalled (&motionArgs));
74597467 ASSERT_EQ (AMOTION_EVENT_ACTION_HOVER_ENTER, motionArgs.action );
74607468 ASSERT_NO_FATAL_FAILURE (assertPointerCoords (motionArgs.pointerCoords [0 ],
7461- toDisplayX (150 ), toDisplayY (250 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7469+ toDisplayX (152 ), toDisplayY (252 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
74627470
74637471 ASSERT_NO_FATAL_FAILURE (mFakeListener ->assertNotifyMotionWasCalled (&motionArgs));
74647472 ASSERT_EQ (AMOTION_EVENT_ACTION_HOVER_MOVE, motionArgs.action );
74657473 ASSERT_NO_FATAL_FAILURE (assertPointerCoords (motionArgs.pointerCoords [0 ],
7466- toDisplayX (150 ), toDisplayY (250 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7474+ toDisplayX (152 ), toDisplayY (252 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
74677475
74687476 // exit hover when pointer goes away
74697477 processId (mapper, -1 );
74707478 processSync (mapper);
74717479 ASSERT_NO_FATAL_FAILURE (mFakeListener ->assertNotifyMotionWasCalled (&motionArgs));
74727480 ASSERT_EQ (AMOTION_EVENT_ACTION_HOVER_EXIT, motionArgs.action );
74737481 ASSERT_NO_FATAL_FAILURE (assertPointerCoords (motionArgs.pointerCoords [0 ],
7474- toDisplayX (150 ), toDisplayY (250 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
7482+ toDisplayX (152 ), toDisplayY (252 ), 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ));
74757483}
74767484
74777485/* *
0 commit comments