diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-07-01 01:00:48 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-07-01 10:29:06 +0200 |
commit | e6c6cc8fde26bd0b9d37a1812593f17df0b4159a (patch) | |
tree | 6aae6724e24a1e051d271e5f67baab5acc358313 /tests/auto/quick/qquickanimations/tst_qquickanimations.cpp | |
parent | 16289f35eb08a9b9a6d56ea8dec549b1f17e4daf (diff) | |
parent | 3ecec55e534214aced70ccab7cc929cfb57738a2 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
src/imports/imports.pro
src/qml/qml/qqmlmetatype.cpp
Change-Id: I308436caf55402cb2246cb591c6ac8f83e1febf8
Diffstat (limited to 'tests/auto/quick/qquickanimations/tst_qquickanimations.cpp')
-rw-r--r-- | tests/auto/quick/qquickanimations/tst_qquickanimations.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp index f5faa14265..48f779a490 100644 --- a/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp +++ b/tests/auto/quick/qquickanimations/tst_qquickanimations.cpp @@ -40,6 +40,7 @@ #include <QtQuick/private/qquickanimatorjob_p.h> #include <QtQuick/private/qquickpathinterpolator_p.h> #include <QtQuick/private/qquickitem_p.h> +#include <QtQuick/private/qquicklistview_p.h> #include <QEasingCurve> #include <limits.h> @@ -110,6 +111,7 @@ private slots: void finished(); void replacingTransitions(); void animationJobSelfDestruction(); + void fastFlickingBug(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -1744,6 +1746,34 @@ void tst_qquickanimations::animationJobSelfDestruction() QTest::qWait(1000); } +void tst_qquickanimations::fastFlickingBug() +{ + // Don't crash + QQmlEngine engine; + engine.clearComponentCache(); + QQmlComponent c(&engine, testFileUrl("fastFlickingBug.qml")); + QScopedPointer<QQuickWindow> win(qobject_cast<QQuickWindow*>(c.create())); + if (!c.errors().isEmpty()) + qDebug() << c.errorString(); + QVERIFY(win); + win->setTitle(QTest::currentTestFunction()); + win->show(); + QVERIFY(QTest::qWaitForWindowExposed(win.data())); + auto timer = win->property("timer").value<QQmlTimer*>(); + QVERIFY(timer); + QCOMPARE(timer->isRunning(), false); + auto listView = win->property("listView").value<QQuickFlickable*>(); + QVERIFY(listView); + timer->start(); + // flick listView up and down quickly in the middle of a slow transition + for (int sign = 1; timer->isRunning(); sign *= -1) { + listView->flick(0, sign * 4000); + qApp->processEvents(); + QTest::qWait(53); + qApp->processEvents(); + } +} + QTEST_MAIN(tst_qquickanimations) #include "tst_qquickanimations.moc" |