aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/snippets/tst_snippets.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-03-29 13:43:29 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-03-29 15:47:39 +0000
commit08a332603c2efb0c64f1570373575f4254220e88 (patch)
tree26d7c37e7c8cbea9ab8484af23ebdbd09611c4ad /tests/auto/snippets/tst_snippets.cpp
parent40f454dbfe0e3c73e9d8a77d58938736000a70f4 (diff)
Attempt to fix tst_snippets on OS X 10.10
Don't show the window until we start taking the screenshots and actually need a visible window. Task-number: QTBUG-58606 Change-Id: I2fcab3b54f0faf67588a21e0732d2e6dbcee9194 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/snippets/tst_snippets.cpp')
-rw-r--r--tests/auto/snippets/tst_snippets.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/auto/snippets/tst_snippets.cpp b/tests/auto/snippets/tst_snippets.cpp
index f870ec7d..cca85b0c 100644
--- a/tests/auto/snippets/tst_snippets.cpp
+++ b/tests/auto/snippets/tst_snippets.cpp
@@ -92,7 +92,7 @@ void tst_Snippets::initTestCase()
Q_DECLARE_METATYPE(QList<QQmlError>)
-static void loadAndShow(QQuickView *view, const QString &source)
+static void loadSnippet(QQuickView *view, const QString &source)
{
qRegisterMetaType<QList<QQmlError> >();
QSignalSpy warnings(view->engine(), SIGNAL(warnings(QList<QQmlError>)));
@@ -112,18 +112,13 @@ static void loadAndShow(QQuickView *view, const QString &source)
QVERIFY(view->rootObject());
QVERIFY(warnings.isEmpty());
-
- view->show();
- view->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(view));
}
void tst_Snippets::verify()
{
QFETCH(QString, input);
- loadAndShow(&view, input);
- QGuiApplication::processEvents();
+ loadSnippet(&view, input);
}
void tst_Snippets::verify_data()
@@ -140,7 +135,11 @@ void tst_Snippets::screenshots()
QFETCH(QString, input);
QFETCH(QString, output);
- loadAndShow(&view, input);
+ loadSnippet(&view, input);
+
+ view.show();
+ view.requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(&view));
QSharedPointer<QQuickItemGrabResult> result = view.contentItem()->grabToImage();
QSignalSpy spy(result.data(), SIGNAL(ready()));