aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-24 16:37:45 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-01-24 18:27:41 +0100
commit22041acdfe85c9a9b814e11cd86e8ee5a55be82d (patch)
tree1b4d1bfa0ebba9e5d1495b5ca7055dba94642c46 /tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
parent6ae57f01bb1495a74b23a81c590672ce788d5400 (diff)
parent2407cd29e628671f7f5144e0d241d4249a3ab612 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/imports/dialogs/qquickmessagedialog.cpp src/imports/dialogs/qquickmessagedialog_p.h src/qml/debugger/qqmlprofilerservice_p.h src/qml/jsruntime/qv4regexpobject.cpp tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro Change-Id: Ic8a43366b44d6970966acbf03b206d0dee00c28d
Diffstat (limited to 'tests/auto/quick/qquickflickable/tst_qquickflickable.cpp')
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp40
1 files changed, 35 insertions, 5 deletions
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 86321c775e..59b54e7ba5 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -1440,17 +1440,23 @@ void tst_qquickflickable::stopAtBounds_data()
{
QTest::addColumn<bool>("transpose");
QTest::addColumn<bool>("invert");
-
- QTest::newRow("left") << false << false;
- QTest::newRow("right") << false << true;
- QTest::newRow("top") << true << false;
- QTest::newRow("bottom") << true << true;
+ QTest::addColumn<bool>("pixelAligned");
+
+ QTest::newRow("left") << false << false << false;
+ QTest::newRow("right") << false << true << false;
+ QTest::newRow("top") << true << false << false;
+ QTest::newRow("bottom") << true << true << false;
+ QTest::newRow("left,pixelAligned") << false << false << true;
+ QTest::newRow("right,pixelAligned") << false << true << true;
+ QTest::newRow("top,pixelAligned") << true << false << true;
+ QTest::newRow("bottom,pixelAligned") << true << true << true;
}
void tst_qquickflickable::stopAtBounds()
{
QFETCH(bool, transpose);
QFETCH(bool, invert);
+ QFETCH(bool, pixelAligned);
QQuickView view;
view.setSource(testFileUrl("stopAtBounds.qml"));
@@ -1469,6 +1475,7 @@ void tst_qquickflickable::stopAtBounds()
flickable->setContentY(invert ? 100 : 0);
else
flickable->setContentX(invert ? 100 : 0);
+ flickable->setPixelAligned(pixelAligned);
const int threshold = qApp->styleHints()->startDragDistance();
@@ -1518,6 +1525,29 @@ void tst_qquickflickable::stopAtBounds()
}
QTest::mouseRelease(&view, Qt::LeftButton, 0, position);
+
+ if (transpose) {
+ flickable->setContentY(invert ? 100 : 0);
+ } else {
+ flickable->setContentX(invert ? 100 : 0);
+ }
+ if (invert)
+ flick(&view, QPoint(20,20), QPoint(100,100), 100);
+ else
+ flick(&view, QPoint(100,100), QPoint(20,20), 100);
+
+ QVERIFY(flickable->isFlicking());
+ if (transpose) {
+ if (invert)
+ QTRY_COMPARE(flickable->isAtYBeginning(), true);
+ else
+ QTRY_COMPARE(flickable->isAtYEnd(), true);
+ } else {
+ if (invert)
+ QTRY_COMPARE(flickable->isAtXBeginning(), true);
+ else
+ QTRY_COMPARE(flickable->isAtXEnd(), true);
+ }
}
void tst_qquickflickable::nestedMouseAreaUsingTouch()