autotests/integration: fix decoration input test

This commit is contained in:
Xaver Hugl 2023-01-18 19:15:29 +01:00
parent 52b4ee3338
commit 3d1101d5ff

View file

@ -168,6 +168,8 @@ void DecorationInputTest::testAxis_data()
void DecorationInputTest::testAxis()
{
static constexpr double oneTick = 15;
const auto [window, surface] = showWindow();
QVERIFY(window);
QVERIFY(window->isDecorated());
@ -183,13 +185,13 @@ void DecorationInputTest::testAxis()
// TODO: mouse wheel direction looks wrong to me
// simulate wheel
Test::pointerAxisVertical(5.0, timestamp++);
Test::pointerAxisVertical(oneTick, timestamp++);
QVERIFY(window->keepBelow());
QVERIFY(!window->keepAbove());
Test::pointerAxisVertical(-5.0, timestamp++);
Test::pointerAxisVertical(-oneTick, timestamp++);
QVERIFY(!window->keepBelow());
QVERIFY(!window->keepAbove());
Test::pointerAxisVertical(-5.0, timestamp++);
Test::pointerAxisVertical(-oneTick, timestamp++);
QVERIFY(!window->keepBelow());
QVERIFY(window->keepAbove());
@ -200,7 +202,7 @@ void DecorationInputTest::testAxis()
QVERIFY(input()->pointer()->decoration());
QCOMPARE(input()->pointer()->decoration()->window(), window);
QTEST(input()->pointer()->decoration()->decoration()->sectionUnderMouse(), "expectedSection");
Test::pointerAxisVertical(5.0, timestamp++);
Test::pointerAxisVertical(oneTick, timestamp++);
QVERIFY(!window->keepBelow());
QVERIFY(!window->keepAbove());
}