diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-06-10 00:34:22 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-06-10 00:34:22 (GMT) |
commit | 8bb9652901085ad27e757848b587fff2ca4c7857 (patch) | |
tree | 283a5c2432447caa2acf5ff7fd79251df8e769af /tests/auto/declarative/qdeclarativeviewer | |
parent | 85864036462e80c18b8a272eb4dcbe339b7033e0 (diff) | |
parent | 6eb8af2ceca2d0fc8b7108bec3525d915d31fe65 (diff) | |
download | Qt-8bb9652901085ad27e757848b587fff2ca4c7857.zip Qt-8bb9652901085ad27e757848b587fff2ca4c7857.tar.gz Qt-8bb9652901085ad27e757848b587fff2ca4c7857.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tests/auto/declarative/qdeclarativeviewer')
-rw-r--r-- | tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp | 17 |
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); |