Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b22d75f6 authored by Prabir Pradhan's avatar Prabir Pradhan Committed by Automerger Merge Worker
Browse files

Fix issues with InputMapper tests am: 36690419

parents c2dfa0d9 36690419
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -2938,6 +2938,8 @@ protected:
        mReader = std::make_unique<InstrumentedInputReader>(mFakeEventHub, mFakePolicy,
                                                            *mFakeListener);
        mDevice = newDevice(DEVICE_ID, DEVICE_NAME, DEVICE_LOCATION, EVENTHUB_ID, classes);
        // Consume the device reset notification generated when adding a new device.
        mFakeListener->assertNotifyDeviceResetWasCalled();
    }

    void SetUp() override {
@@ -2962,6 +2964,8 @@ protected:
            mReader->loopOnce();
        }
        mDevice->configure(ARBITRARY_TIME, mFakePolicy->getReaderConfiguration(), changes);
        // Loop the reader to flush the input listener queue.
        mReader->loopOnce();
    }

    std::shared_ptr<InputDevice> newDevice(int32_t deviceId, const std::string& name,
@@ -2985,6 +2989,8 @@ protected:
        configureDevice(0);
        mDevice->reset(ARBITRARY_TIME);
        mapper.reset(ARBITRARY_TIME);
        // Loop the reader to flush the input listener queue.
        mReader->loopOnce();
        return mapper;
    }

@@ -3010,6 +3016,7 @@ protected:
        event.code = code;
        event.value = value;
        mapper.process(&event);
        // Loop the reader to flush the input listener queue.
        mReader->loopOnce();
    }

@@ -4907,7 +4914,6 @@ TEST_F(CursorInputMapperTest, Process_PointerCapture) {
    ASSERT_TRUE(mReader->getContext()->getGeneration() != generation);

    ASSERT_NO_FATAL_FAILURE(mFakeListener->assertNotifyDeviceResetWasCalled(&resetArgs));
    ASSERT_EQ(ARBITRARY_TIME, resetArgs.eventTime);
    ASSERT_EQ(DEVICE_ID, resetArgs.deviceId);

    process(mapper, ARBITRARY_TIME, READ_TIME, EV_REL, REL_X, 10);