aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-04-02 09:41:02 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-07 15:50:23 +0200
commit0a74379a57bcf68328ab167121c2dd16fc2d47c3 (patch)
tree04ca93f291bfcd2da84319202b4c073034f65054 /tests
parentb50090e79b122c9de1560a99d1f8aebcc1e24a3a (diff)
OSX: fix QQuickListView test
outsideViewportChangeNotAffectingView was failing on OSX. Make the window larger; flick a longer distance in the same time to ensure that the flick takes the list to the end. Task-number: QTBUG-37828 Task-number: QTBUG-27740 Change-Id: Iefa44942a8f8318861781db820e830b459114a83 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml10
-rw-r--r--tests/auto/quick/qquicklistview/qquicklistview.pro1
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp18
3 files changed, 16 insertions, 13 deletions
diff --git a/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml b/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml
index 7903c392d1..c57cde5eda 100644
--- a/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml
+++ b/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml
@@ -42,13 +42,16 @@ import QtQuick 2.1
import QtTest 1.0
Item {
+ width: 300
+ height: 542
+
function resizeThirdItem(size) {
resizingListModel.setProperty(3, "size", size)
}
ListView {
- width: 300
- height: 542
+ id: list
+ anchors.fill: parent
model: ListModel {
id: resizingListModel
ListElement { size: 300; }
@@ -62,6 +65,9 @@ Item {
width: parent.width
color: index % 2 == 0 ? "red" : "blue"
height: size
+ Text { anchors.centerIn: parent; text: index }
}
}
+
+ Text { text: list.contentY; color: "white" }
}
diff --git a/tests/auto/quick/qquicklistview/qquicklistview.pro b/tests/auto/quick/qquicklistview/qquicklistview.pro
index 4ac47679da..2ae04d32fe 100644
--- a/tests/auto/quick/qquicklistview/qquicklistview.pro
+++ b/tests/auto/quick/qquicklistview/qquicklistview.pro
@@ -17,4 +17,3 @@ TESTDATA = data/*
QT += core-private gui-private qml-private quick-private testlib
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
-mac:CONFIG += insignificant_test # QTBUG-27740
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index 60c2fadb23..288c0d0a58 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -3347,9 +3347,9 @@ void tst_QQuickListView::modelChanges()
void tst_QQuickListView::QTBUG_9791()
{
QQuickView *window = createView();
-
window->setSource(testFileUrl("strictlyenforcerange.qml"));
- qApp->processEvents();
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
QQuickListView *listview = qobject_cast<QQuickListView*>(window->rootObject());
QTRY_VERIFY(listview != 0);
@@ -7047,9 +7047,7 @@ void tst_QQuickListView::outsideViewportChangeNotAffectingView()
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
- flick(window, QPoint(20, 200), QPoint(20, 20), 10);
-
- QTRY_COMPARE(listview->isFlicking(), false);
+ listview->setContentY(1250);
QTRY_COMPARE(listview->indexAt(0, listview->contentY()), 4);
QTRY_COMPARE(listview->itemAt(0, listview->contentY())->y(), 1200.);
@@ -7147,12 +7145,12 @@ void tst_QQuickListView::displayMargin()
void tst_QQuickListView::highlightItemGeometryChanges()
{
- QQmlEngine engine;
- QQmlComponent component(&engine, testFileUrl("HighlightResize.qml"));
-
- QScopedPointer<QObject> object(component.create());
+ QScopedPointer<QQuickView> window(createView());
+ window->setSource(testFileUrl("HighlightResize.qml"));
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
- QQuickListView *listview = qobject_cast<QQuickListView *>(object.data());
+ QQuickListView *listview = qobject_cast<QQuickListView *>(window->rootObject());
QVERIFY(listview);
QCOMPARE(listview->count(), 5);