diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-03-17 09:32:34 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-03-17 09:52:19 +0100 |
commit | fb0cb17cb55c9ed44b7fcbc92efcc244e96c9b36 (patch) | |
tree | 2ba609d4c6416036d3cb5f345a6c1125e0f105d6 /tests/auto/quick | |
parent | 4dc68ba888c7dbb7bd16455991f6d5814df13cba (diff) | |
parent | 84155a8e1a6250d3e4b0949a42464eee5dfef537 (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I6033aba359ac551f450ad517d20a0986bf4655f6
Diffstat (limited to 'tests/auto/quick')
4 files changed, 78 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickanimatedimage/data/colors_nocache.qml b/tests/auto/quick/qquickanimatedimage/data/colors_nocache.qml new file mode 100644 index 0000000000..24adca68ec --- /dev/null +++ b/tests/auto/quick/qquickanimatedimage/data/colors_nocache.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +AnimatedImage { + source: "colors.gif" + cache: false +} diff --git a/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp b/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp index ee38a0e8ff..c42000d418 100644 --- a/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp +++ b/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp @@ -70,6 +70,7 @@ private slots: void qtbug_16520(); void progressAndStatusChanges(); void playingAndPausedChanges(); + void noCaching(); }; void tst_qquickanimatedimage::cleanup() @@ -528,6 +529,39 @@ void tst_qquickanimatedimage::playingAndPausedChanges() delete obj; } + +void tst_qquickanimatedimage::noCaching() +{ + QQuickView window, window_nocache; + window.setSource(testFileUrl("colors.qml")); + window_nocache.setSource(testFileUrl("colors_nocache.qml")); + window.show(); + window_nocache.show(); + QTest::qWaitForWindowExposed(&window); + QTest::qWaitForWindowExposed(&window_nocache); + + QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(window.rootObject()); + QVERIFY(anim); + + QQuickAnimatedImage *anim_nocache = qobject_cast<QQuickAnimatedImage *>(window_nocache.rootObject()); + QVERIFY(anim_nocache); + + QCOMPARE(anim->frameCount(), anim_nocache->frameCount()); + + // colors.gif only has 3 frames so this should be fast + for (int loops = 0; loops <= 2; ++loops) { + for (int frame = 0; frame < anim->frameCount(); ++frame) { + anim->setCurrentFrame(frame); + anim_nocache->setCurrentFrame(frame); + + QImage image_cache = window.grabWindow(); + QImage image_nocache = window_nocache.grabWindow(); + + QCOMPARE(image_cache, image_nocache); + } + } +} + QTEST_MAIN(tst_qquickanimatedimage) #include "tst_qquickanimatedimage.moc" diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp index 86baed4e51..5c96cc151e 100644 --- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp +++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp @@ -1493,6 +1493,40 @@ void tst_qquickflickable::nestedStopAtBounds() QTest::mouseRelease(&view, Qt::LeftButton, 0, position); QTRY_VERIFY(!outer->isMoving()); + + axis = 200; + inner->setContentX(0); + inner->setContentY(0); + inner->setContentWidth(inner->width()); + inner->setContentHeight(inner->height()); + + // Drag inner with equal size and contentSize + QTest::mousePress(&view, Qt::LeftButton, 0, position); + QTest::qWait(10); + axis += invert ? -threshold * 2 : threshold * 2; + QTest::mouseMove(&view, position); + axis += invert ? -threshold : threshold; + QTest::mouseMove(&view, position); + QCOMPARE(outer->isDragging(), true); + QCOMPARE(inner->isDragging(), false); + QTest::mouseRelease(&view, Qt::LeftButton, 0, position); + + axis = 200; + inner->setContentX(0); + inner->setContentY(0); + inner->setContentWidth(inner->width() - 100); + inner->setContentHeight(inner->height() - 100); + + // Drag inner with size greater than contentSize + QTest::mousePress(&view, Qt::LeftButton, 0, position); + QTest::qWait(10); + axis += invert ? -threshold * 2 : threshold * 2; + QTest::mouseMove(&view, position); + axis += invert ? -threshold : threshold; + QTest::mouseMove(&view, position); + QCOMPARE(outer->isDragging(), true); + QCOMPARE(inner->isDragging(), false); + QTest::mouseRelease(&view, Qt::LeftButton, 0, position); } void tst_qquickflickable::stopAtBounds_data() diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp index 4f45d0c076..7db15522b5 100644 --- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp +++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp @@ -1503,6 +1503,10 @@ void tst_QQuickPathView::mouseDrag() QGuiApplication::sendEvent(window.data(), &mv); } // next move beyond threshold does trigger drag +#ifdef Q_OS_WIN + if (!pathview->isMoving()) + QSKIP("Skipping due to interference from external mouse move events."); +#endif // Q_OS_WIN QVERIFY(pathview->isMoving()); QVERIFY(pathview->isDragging()); QCOMPARE(movingSpy.count(), 1); |