summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2014-01-10 18:08:17 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-15 01:10:19 +0100
commitb5ceb6edf14988eed9826db4773e608754629848 (patch)
tree45bef8ea7e2e0a5939cd88abea76d153d54cd200 /tests
parent679ea13790f217df0bb240fb80fd4ee5208e2084 (diff)
Fix RenderNode autotest on BlackBerry
On BlackBerry the first window that is created is always shown as fullscreen. This is a platform restriction and possibly applies to other platforms as well. The autotest however expects the window to be of a specific size. As workaround a "container" window is created first in which the QQuickView is placed. Change-Id: Ib9023cfcb9148c6cafb21872c2821ebcb8fd664f Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/rendernode/tst_rendernode.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/auto/quick/rendernode/tst_rendernode.cpp b/tests/auto/quick/rendernode/tst_rendernode.cpp
index 7d1590e5f6..06338e09e2 100644
--- a/tests/auto/quick/rendernode/tst_rendernode.cpp
+++ b/tests/auto/quick/rendernode/tst_rendernode.cpp
@@ -57,18 +57,18 @@ public:
QImage runTest(const QString &fileName)
{
- QQuickView view;
- view.setSource(testFileUrl(fileName));
+ QQuickView view(&outerWindow);
view.setResizeMode(QQuickView::SizeViewToRootObject);
- const QRect screenGeometry = view.screen()->availableGeometry();
- const QSize size = view.size();
- const QPoint offset = QPoint(size.width() / 2, size.height() / 2);
- view.setFramePosition(screenGeometry.center() - offset);
- view.showNormal();
+ view.setSource(testFileUrl(fileName));
+ view.setVisible(true);
QTest::qWaitForWindowExposed(&view);
return view.grabWindow();
}
+ //It is important for platforms that only are able to show fullscreen windows
+ //to have a container for the window that is painted on.
+ QQuickWindow outerWindow;
+
private slots:
void renderOrder();
void messUpState();
@@ -187,6 +187,8 @@ tst_rendernode::tst_rendernode()
{
qmlRegisterType<ClearItem>("Test", 1, 0, "ClearItem");
qmlRegisterType<MessUpItem>("Test", 1, 0, "MessUpItem");
+ outerWindow.showNormal();
+ outerWindow.setGeometry(0,0,400,400);
}
static bool fuzzyCompareColor(QRgb x, QRgb y, QByteArray *errorMessage)