diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-03-31 15:45:45 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-03-31 15:45:46 +0200 |
commit | 92dcf9e69e5ed42471d4e02eb165bc80f550129e (patch) | |
tree | fcb56709e15991d40de4ef695ac27831cb062a38 /src/qmltest/quicktest.cpp | |
parent | 03fa9780fa1ac8bab10f99a59dd3fc2f8f878222 (diff) | |
parent | 22b7fd1c0b93f12585858ac5baabba32408749fd (diff) |
Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I54e66e992f5e5d441b8b5394e7a03ec5352e7bf3
Diffstat (limited to 'src/qmltest/quicktest.cpp')
-rw-r--r-- | src/qmltest/quicktest.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index 947039f60e..5e9712d202 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -350,6 +350,8 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD if (QTest::printAvailableFunctions) continue; + while (view->status() == QQuickView::Loading) + QTest::qWait(10); if (view->status() == QQuickView::Error) { handleCompileErrors(fi, view); continue; @@ -368,14 +370,22 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD view->resize(200, 200); } view->show(); + if (!QTest::qWaitForWindowExposed(view)) { + qWarning().nospace() + << "Test '" << QDir::toNativeSeparators(path) << "' window not exposed after show()."; + } view->requestActivate(); - - while (view->status() == QQuickView::Loading) - QTest::qWait(10); - - QTest::qWaitForWindowActive(view); - if (view->isExposed()) + if (!QTest::qWaitForWindowActive(view)) { + qWarning().nospace() + << "Test '" << QDir::toNativeSeparators(path) << "' window not active after requestActivate()."; + } + if (view->isExposed()) { QTestRootObject::instance()->setWindowShown(true); + } else { + qWarning().nospace() + << "Test '" << QDir::toNativeSeparators(path) << "' window was never exposed! " + << "If the test case was expecting windowShown, it will hang."; + } if (!QTestRootObject::instance()->hasQuit && QTestRootObject::instance()->hasTestCase()) eventLoop.exec(); // view->hide(); Causes a crash in Qt 3D due to deletion of the GL context, see QTBUG-27696 |