aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickgridview
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2014-09-22 13:52:56 +0200
committerJan Arve Sæther <jan-arve.saether@digia.com>2014-09-25 21:24:09 +0200
commit667728a9da5331dad253d047153daec8a2c1ff55 (patch)
tree91611f5927771e70cac17413c21710d0b36b68e2 /tests/auto/quick/qquickgridview
parent05f767f777d92f41cec1d8bb9a512b1f2e40ef5f (diff)
Do not fail test because window moves out of desktop area bounds.
For some reason the window moved in the bottom-right direction each time the window was resized. This could cause the window to move out of the bounds of the desktop area, which again could cause an autotest failure. We therefore ensure that the window is centered for each test call. Task-number: QTBUG-33017 Change-Id: I0a2b9bb4ba866d8a3f80309c6b33863bab4d2bcf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickgridview')
-rw-r--r--tests/auto/quick/qquickgridview/data/resizegrid.qml2
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp1
2 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickgridview/data/resizegrid.qml b/tests/auto/quick/qquickgridview/data/resizegrid.qml
index 7ea2f120e8..75f1d77f10 100644
--- a/tests/auto/quick/qquickgridview/data/resizegrid.qml
+++ b/tests/auto/quick/qquickgridview/data/resizegrid.qml
@@ -2,6 +2,8 @@ import QtQuick 2.0
Rectangle {
id: root
+ width: 260
+ height: 320
Component {
id: myDelegate
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index b65aad543d..33008a9d1b 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -3707,6 +3707,7 @@ void tst_QQuickGridView::resizeGrid()
ctxt->setContextProperty("testRightToLeft", layoutDirection == Qt::RightToLeft);
ctxt->setContextProperty("testBottomToTop", verticalLayoutDirection == QQuickGridView::BottomToTop);
window->setSource(testFileUrl("resizegrid.qml"));
+ QQuickViewTestUtil::centerOnScreen(window, window->size());
window->show();
qApp->processEvents();