[autotests] Fix PointerInputTest::testCursorImage()

Summary:
    FAIL!  : KWin::PointerInputTest::testCursorImage() Compared QImages differ in device pixel ratio.
       Actual   (((p->cursorImage()))): 2
       Expected (blueScaled): 1
       Loc: [/home/vlad/Workspace/KDE/src/kde/workspace/kwin/autotests/integration/pointer_input.cpp(1058)]

Test Plan: The test passes.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27725
This commit is contained in:
Vlad Zahorodnii 2020-02-28 19:06:19 +02:00
parent fb114dfba3
commit fcea0eb218

View file

@ -1048,6 +1048,7 @@ void PointerInputTest::testCursorImage()
// scaled cursor // scaled cursor
QImage blueScaled = QImage(QSize(20, 20), QImage::Format_ARGB32_Premultiplied); QImage blueScaled = QImage(QSize(20, 20), QImage::Format_ARGB32_Premultiplied);
blueScaled.setDevicePixelRatio(2);
blueScaled.fill(Qt::blue); blueScaled.fill(Qt::blue);
auto bs = Test::waylandShmPool()->createBuffer(blueScaled); auto bs = Test::waylandShmPool()->createBuffer(blueScaled);
cursorSurface->attachBuffer(bs); cursorSurface->attachBuffer(bs);
@ -1056,7 +1057,6 @@ void PointerInputTest::testCursorImage()
cursorSurface->commit(); cursorSurface->commit();
QVERIFY(cursorRenderedSpy.wait()); QVERIFY(cursorRenderedSpy.wait());
QTRY_COMPARE(p->cursorImage(), blueScaled); QTRY_COMPARE(p->cursorImage(), blueScaled);
QCOMPARE(p->cursorImage().devicePixelRatio(), 2.0);
QCOMPARE(p->cursorHotSpot(), QPoint(6, 6)); //surface-local (so not changed) QCOMPARE(p->cursorHotSpot(), QPoint(6, 6)); //surface-local (so not changed)
// hide the cursor // hide the cursor