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

Commit 85daa5d0 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

PointerChoreographerTest: Use builders to generate motion and key args

NotifyMotionArgs in particular have specific requirements, like needing
at least one pointer. Use a builder to generate these, instead of
relying on the default-constructed object.

Bug: 309479677
Test: atest inputflinger_tests
Change-Id: I5eccaff0eff2d87aa8d6c13a9659eed34e45c3da
parent 15b56fd2
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -145,10 +145,13 @@ private:
};

TEST_F(PointerChoreographerTest, ForwardsArgsToInnerListener) {
    const std::vector<NotifyArgs> allArgs{NotifyInputDevicesChangedArgs{},
    const std::vector<NotifyArgs>
            allArgs{NotifyInputDevicesChangedArgs{},
                    NotifyConfigurationChangedArgs{},
                                          NotifyKeyArgs{},
                                          NotifyMotionArgs{},
                    KeyArgsBuilder(AKEY_EVENT_ACTION_DOWN, AINPUT_SOURCE_KEYBOARD).build(),
                    MotionArgsBuilder(AMOTION_EVENT_ACTION_DOWN, AINPUT_SOURCE_TOUCHSCREEN)
                            .pointer(FIRST_TOUCH_POINTER)
                            .build(),
                    NotifySensorArgs{},
                    NotifySwitchArgs{},
                    NotifyDeviceResetArgs{},