diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-03-27 10:16:18 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-27 10:16:18 +0100 |
commit | 0ee112dcc5174f41427630ce76f4f5ed232c4bba (patch) | |
tree | 6f86ddd072b123d1f2100e2596ca8b07cf27b586 /tests/auto | |
parent | 9df65c172bc33774bad17da7f9cb66184578d49a (diff) | |
parent | ea3951ed47d9cf5a9e28b6f776098c9f3132a4bb (diff) |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp | 6 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp | 24 |
2 files changed, 18 insertions, 12 deletions
diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp index b0fa7bd6..c8a98d33 100644 --- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp +++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp @@ -576,6 +576,9 @@ void tst_qdeclarativeflickable::nestedStopAtBounds() axis += invert ? threshold : -threshold; moveEvent.setScenePos(position); QApplication::sendEvent(view.scene(), &moveEvent); + axis += invert ? threshold : -threshold; + moveEvent.setScenePos(position); + QApplication::sendEvent(view.scene(), &moveEvent); QVERIFY(outer->contentX() != 50 || outer->contentY() != 50); QVERIFY((inner->contentX() == 0 || inner->contentX() == 100) && (inner->contentY() == 0 || inner->contentY() == 100)); @@ -594,6 +597,9 @@ void tst_qdeclarativeflickable::nestedStopAtBounds() axis += invert ? -threshold : threshold; moveEvent.setScenePos(position); QApplication::sendEvent(view.scene(), &moveEvent); + axis += invert ? -threshold : threshold; + moveEvent.setScenePos(position); + QApplication::sendEvent(view.scene(), &moveEvent); QVERIFY(outer->contentX() == 50 && outer->contentY() == 50); QVERIFY((inner->contentX() != 0 && inner->contentX() != 100) || (inner->contentY() != 0 && inner->contentY() != 100)); diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index 37e64d4d..0415c5c9 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -239,18 +239,18 @@ void tst_QDeclarativeMouseArea::dragging() QApplication::sendEvent(scene, &moveEvent); QVERIFY(drag->active()); - QCOMPARE(blackRect->x(), 72.0); - QCOMPARE(blackRect->y(), 72.0); + QCOMPARE(blackRect->x(), 61.0); + QCOMPARE(blackRect->y(), 61.0); QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease); - releaseEvent.setScenePos(QPointF(110, 110)); + releaseEvent.setScenePos(QPointF(122, 122)); releaseEvent.setButton(Qt::LeftButton); releaseEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(scene, &releaseEvent); QVERIFY(!drag->active()); - QCOMPARE(blackRect->x(), 72.0); - QCOMPARE(blackRect->y(), 72.0); + QCOMPARE(blackRect->x(), 61.0); + QCOMPARE(blackRect->y(), 61.0); delete canvas; } @@ -597,8 +597,8 @@ void tst_QDeclarativeMouseArea::preventStealing() QVERIFY(!mouseArea->pressed()); // Flickable content should have moved. - QCOMPARE(flickable->contentX(), 30.); - QCOMPARE(flickable->contentY(), 30.); + QCOMPARE(flickable->contentX(), 15.); + QCOMPARE(flickable->contentY(), 15.); QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(50, 50))); @@ -741,14 +741,14 @@ void tst_QDeclarativeMouseArea::changeAxis() QApplication::sendEvent(scene, &moveEvent); QVERIFY(drag->active()); - QCOMPARE(blackRect->x(), 72.0); - QCOMPARE(blackRect->y(), 72.0); + QCOMPARE(blackRect->x(), 61.0); + QCOMPARE(blackRect->y(), 61.0); QCOMPARE(drag->axis(), QDeclarativeDrag::XandYAxis); /* When blackRect.x becomes bigger than 75, the drag axis is change to * Drag.YAxis by the QML code. Verify that this happens, and that the drag * movement is effectively constrained to the Y axis. */ - moveEvent.setScenePos(QPointF(133, 133)); + moveEvent.setScenePos(QPointF(144, 144)); moveEvent.setButton(Qt::LeftButton); moveEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(scene, &moveEvent); @@ -757,7 +757,7 @@ void tst_QDeclarativeMouseArea::changeAxis() QCOMPARE(blackRect->y(), 83.0); QCOMPARE(drag->axis(), QDeclarativeDrag::YAxis); - moveEvent.setScenePos(QPointF(144, 144)); + moveEvent.setScenePos(QPointF(155, 155)); moveEvent.setButton(Qt::LeftButton); moveEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(scene, &moveEvent); @@ -766,7 +766,7 @@ void tst_QDeclarativeMouseArea::changeAxis() QCOMPARE(blackRect->y(), 94.0); QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease); - releaseEvent.setScenePos(QPointF(144, 144)); + releaseEvent.setScenePos(QPointF(155, 155)); releaseEvent.setButton(Qt::LeftButton); releaseEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(scene, &releaseEvent); |