summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeviewer
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativeviewer')
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
index 8626560..ef99173 100644
--- a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
+++ b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
@@ -45,6 +45,7 @@
#include <QtDeclarative/qdeclarativeitem.h>
#include "../../../shared/util.h"
#include "qmlruntime.h"
+#include "../../../shared/util.h"
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -86,6 +87,10 @@ void tst_QDeclarativeViewer::orientation()
QVERIFY(rootItem);
window.show();
+ QApplication::setActiveWindow(&window);
+ QTest::qWaitForWindowShown(&window);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&window));
+
QCOMPARE(rootItem->width(), 200.0);
QCOMPARE(rootItem->height(), 300.0);
QCOMPARE(viewer->view()->size(), QSize(200, 300));
@@ -126,6 +131,10 @@ void tst_QDeclarativeViewer::loading()
QVERIFY(rootItem);
viewer->show();
+ QApplication::setActiveWindow(viewer);
+ QTest::qWaitForWindowShown(viewer);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(viewer));
+
// initial size
QTRY_COMPARE(rootItem->width(), 200.0);
QTRY_COMPARE(rootItem->height(), 300.0);
@@ -193,6 +202,10 @@ void tst_QDeclarativeViewer::fileBrowser()
viewer->openFile();
viewer->show();
+ QApplication::setActiveWindow(viewer);
+ QTest::qWaitForWindowShown(viewer);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(viewer));
+
// Browser.qml successfully loaded
QDeclarativeItem* browserItem = qobject_cast<QDeclarativeItem*>(viewer->view()->rootObject());
QVERIFY(viewer->view());
@@ -226,6 +239,10 @@ void tst_QDeclarativeViewer::resizing()
QVERIFY(rootItem);
viewer->show();
+ QApplication::setActiveWindow(viewer);
+ QTest::qWaitForWindowShown(viewer);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(viewer));
+
// initial size
QCOMPARE(rootItem->width(), 200.0);
QCOMPARE(rootItem->height(), 300.0);