diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/quick/qquickitem/tst_qquickitem.cpp | 7 | ||||
-rw-r--r-- | tests/auto/quick/qquicktext/BLACKLIST | 2 | ||||
-rw-r--r-- | tests/auto/quick/qquicktextedit/BLACKLIST | 2 | ||||
-rw-r--r-- | tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp | 16 |
4 files changed, 13 insertions, 14 deletions
diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp index 536bb40dcc..d0139b6cdf 100644 --- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp @@ -48,7 +48,7 @@ public: TestItem(QQuickItem *parent = 0) : QQuickItem(parent), focused(false), pressCount(0), releaseCount(0) , wheelCount(0), acceptIncomingTouchEvents(true) - , touchEventReached(false) {} + , touchEventReached(false), timestamp(0) {} bool focused; int pressCount; @@ -56,6 +56,7 @@ public: int wheelCount; bool acceptIncomingTouchEvents; bool touchEventReached; + ulong timestamp; protected: virtual void focusInEvent(QFocusEvent *) { Q_ASSERT(!focused); focused = true; } virtual void focusOutEvent(QFocusEvent *) { Q_ASSERT(focused); focused = false; } @@ -65,7 +66,7 @@ protected: touchEventReached = true; event->setAccepted(acceptIncomingTouchEvents); } - virtual void wheelEvent(QWheelEvent *event) { event->accept(); ++wheelCount; } + virtual void wheelEvent(QWheelEvent *event) { event->accept(); ++wheelCount; timestamp = event->timestamp(); } }; class TestWindow: public QQuickWindow @@ -1432,12 +1433,14 @@ void tst_qquickitem::wheelEvent() item->setVisible(visible); QWheelEvent event(QPoint(100, 50), -120, Qt::NoButton, Qt::NoModifier, Qt::Vertical); + event.setTimestamp(123456UL); event.setAccepted(false); QGuiApplication::sendEvent(&window, &event); if (shouldReceiveWheelEvents) { QVERIFY(event.isAccepted()); QCOMPARE(item->wheelCount, 1); + QCOMPARE(item->timestamp, 123456UL); } else { QVERIFY(!event.isAccepted()); QCOMPARE(item->wheelCount, 0); diff --git a/tests/auto/quick/qquicktext/BLACKLIST b/tests/auto/quick/qquicktext/BLACKLIST index 223d8feb67..c2e7ef03c0 100644 --- a/tests/auto/quick/qquicktext/BLACKLIST +++ b/tests/auto/quick/qquicktext/BLACKLIST @@ -1,6 +1,4 @@ [dependentImplicitSizes] * -[mouseSelection] -* [lineLaidOutRelayout] msvc-2015 diff --git a/tests/auto/quick/qquicktextedit/BLACKLIST b/tests/auto/quick/qquicktextedit/BLACKLIST index 297146195b..5f3208f848 100644 --- a/tests/auto/quick/qquicktextedit/BLACKLIST +++ b/tests/auto/quick/qquicktextedit/BLACKLIST @@ -1,5 +1,3 @@ -[mouseSelection] -* [undo] * [undo_keypressevents] diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp index b7bfc357f3..cb2a7bfd83 100644 --- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp +++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp @@ -2003,12 +2003,18 @@ void tst_qquicktextedit::mouseSelection() else if (clicks == 3) QTest::mouseDClick(&window, Qt::LeftButton, Qt::NoModifier, p1); QTest::mousePress(&window, Qt::LeftButton, Qt::NoModifier, p1); + if (clicks == 2) { + // QTBUG-50022: Since qtbase commit beef975, QTestLib avoids generating + // double click events by adding 500ms delta to release event timestamps. + // Send a double click event by hand to ensure the correct sequence: + // press, release, press, _dbl click_, move, release. + QMouseEvent dblClickEvent(QEvent::MouseButtonDblClick, p1, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); + QGuiApplication::sendEvent(textEditObject, &dblClickEvent); + } QTest::mouseMove(&window, p2); QTest::mouseRelease(&window, Qt::LeftButton, Qt::NoModifier, p2); QTRY_COMPARE(textEditObject->selectedText(), selectedText); - QTest::qWait(QGuiApplication::styleHints()->mouseDoubleClickInterval() + 10); - // Clicking and shift to clicking between the same points should select the same text. textEditObject->setCursorPosition(0); if (clicks > 1) @@ -2017,9 +2023,6 @@ void tst_qquicktextedit::mouseSelection() QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, p1); QTest::mouseClick(&window, Qt::LeftButton, Qt::ShiftModifier, p2); QTRY_COMPARE(textEditObject->selectedText(), selectedText); - - // ### This is to prevent double click detection from carrying over to the next test. - QTest::qWait(QGuiApplication::styleHints()->mouseDoubleClickInterval() + 10); } void tst_qquicktextedit::dragMouseSelection() @@ -2960,9 +2963,6 @@ void tst_qquicktextedit::middleClickPaste() // Middle click pastes the selected text, assuming the platform supports it. QTest::mouseClick(&window, Qt::MiddleButton, Qt::NoModifier, p3); - // ### This is to prevent double click detection from carrying over to the next test. - QTest::qWait(QGuiApplication::styleHints()->mouseDoubleClickInterval() + 10); - if (QGuiApplication::clipboard()->supportsSelection()) QCOMPARE(textEditObject->text().mid(1, selectedText.length()), selectedText); else |