mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 02:45:38 +00:00
Test pixel pushing
This commit is contained in:
parent
5db87d4d6f
commit
2aa006fa87
|
@ -207,13 +207,17 @@ void PartTest::testSelectText()
|
|||
|
||||
QVERIFY(QMetaObject::invokeMethod(part.m_pageView, "slotSetMouseTextSelect"));
|
||||
|
||||
QTest::mouseMove(part.m_pageView->viewport(), QPoint(width * 0.12, height * 0.055));
|
||||
QTest::mousePress(part.m_pageView->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(width * 0.12, height * 0.055));
|
||||
QTest::mouseMove(part.m_pageView->viewport(), QPoint(width * 0.8, height * 0.055));
|
||||
const int mouseY = height * 0.052;
|
||||
const int mouseStartX = width * 0.12;
|
||||
const int mouseEndX = width * 0.7;
|
||||
|
||||
QTest::mouseMove(part.m_pageView->viewport(), QPoint(mouseStartX, mouseY));
|
||||
QTest::mousePress(part.m_pageView->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(mouseStartX, mouseY));
|
||||
QTest::mouseMove(part.m_pageView->viewport(), QPoint(mouseEndX, mouseY));
|
||||
// without this wait the test fails. 100ms were enough on my local system, but when running under valgrind
|
||||
// or on the CI server we need to wait longer.
|
||||
QTest::qWait(1000);
|
||||
QTest::mouseRelease(part.m_pageView->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(width * 0.8, height * 0.055));
|
||||
QTest::mouseRelease(part.m_pageView->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(mouseEndX, mouseY));
|
||||
|
||||
QApplication::clipboard()->clear();
|
||||
QVERIFY(QMetaObject::invokeMethod(part.m_pageView, "copyTextSelection"));
|
||||
|
|
Loading…
Reference in a new issue