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