File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ sp<IInputFlinger> getInputFlinger() {
8585// We use the top 10 layers as a way to haphazardly place ourselves above anything else.
8686static const int LAYER_BASE = INT32_MAX - 10 ;
8787static constexpr std::chrono::nanoseconds DISPATCHING_TIMEOUT = 5s;
88+ static constexpr float EPSILON = MotionEvent::ROUNDING_PRECISION;
8889
8990class SynchronousWindowInfosReportedListener : public gui ::BnWindowInfosReportedListener {
9091public:
@@ -203,8 +204,8 @@ class InputSurface {
203204 ASSERT_EQ (InputEventType::MOTION, ev->getType ());
204205 MotionEvent* mev = static_cast <MotionEvent*>(ev);
205206 EXPECT_EQ (AMOTION_EVENT_ACTION_DOWN, mev->getAction ());
206- EXPECT_EQ (x, mev->getX (0 ));
207- EXPECT_EQ (y, mev->getY (0 ));
207+ EXPECT_NEAR (x, mev->getX (0 ), EPSILON );
208+ EXPECT_NEAR (y, mev->getY (0 ), EPSILON );
208209 EXPECT_EQ (0 , mev->getFlags () & VERIFIED_MOTION_EVENT_FLAGS);
209210
210211 ev = consumeEvent ();
You can’t perform that action at this time.
0 commit comments