From 08a332603c2efb0c64f1570373575f4254220e88 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 29 Mar 2017 13:43:29 +0200 Subject: 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 Reviewed-by: Qt CI Bot --- tests/auto/snippets/tst_snippets.cpp | 15 +++++++-------- 1 file 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) -static void loadAndShow(QQuickView *view, const QString &source) +static void loadSnippet(QQuickView *view, const QString &source) { qRegisterMetaType >(); QSignalSpy warnings(view->engine(), SIGNAL(warnings(QList))); @@ -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 result = view.contentItem()->grabToImage(); QSignalSpy spy(result.data(), SIGNAL(ready())); -- cgit v1.2.3