summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Richardson <arichardson.kde@gmail.com>2015-11-28 15:53:23 (GMT)
committerAlex Richardson <arichardson.kde@gmail.com>2015-11-28 16:04:57 (GMT)
commitde6443d106b87c0036dc32adc8727af37b2f2683 (patch)
tree1f08caf533616915c387cf2049900ba75e0a9217
parent19c2c170bbe5833c6b17db7ac348496a8f42aec8 (diff)
Fix PartTest::testSelectText()
With Qt5 we need a qWait before the mouseRelease otherwise the selection will not be made
-rw-r--r--autotests/parttest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/autotests/parttest.cpp b/autotests/parttest.cpp
index 38c1753..3094cb4 100644
--- a/autotests/parttest.cpp
+++ b/autotests/parttest.cpp
@@ -189,18 +189,18 @@ void PartTest::testSelectText()
part.m_document->setViewportPage(0);
// wait for pixmap
- while (!part.m_document->page(0)->hasPixmap(part.m_pageView))
- QTest::qWait(100);
+ QTRY_VERIFY(part.m_document->page(0)->hasPixmap(part.m_pageView));
- QMetaObject::invokeMethod(part.m_pageView, "slotSetMouseTextSelect");
+ QVERIFY(QMetaObject::invokeMethod(part.m_pageView, "slotSetMouseTextSelect"));
QTest::mouseMove(part.m_pageView->viewport(), QPoint(width * 0.12, height * 0.16));
QTest::mousePress(part.m_pageView->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(width * 0.12, height * 0.16));
QTest::mouseMove(part.m_pageView->viewport(), QPoint(width * 0.8, height * 0.16));
+ QTest::qWait(100); // without this wait the test fails
QTest::mouseRelease(part.m_pageView->viewport(), Qt::LeftButton, Qt::NoModifier, QPoint(width * 0.8, height * 0.16));
QApplication::clipboard()->clear();
- QMetaObject::invokeMethod(part.m_pageView, "copyTextSelection");
+ QVERIFY(QMetaObject::invokeMethod(part.m_pageView, "copyTextSelection"));
QCOMPARE(QApplication::clipboard()->text(), QString("Hola que tal\n"));
}