aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickshape/tst_qquickshape.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-08-15 18:40:58 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-08-15 18:44:54 +0200
commit2be575b4b1e6f6e11a8dbd0b1c05c003828d2598 (patch)
tree55d2bfaff9583b3e1e9f3291f4b91f34adae1d92 /tests/auto/quick/qquickshape/tst_qquickshape.cpp
parent4a5939d26d1e36efdb2b30cdee1f3672587c3fa5 (diff)
parent9e32b23a1514f367921b4a9ee25bc864a008463c (diff)
Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Diffstat (limited to 'tests/auto/quick/qquickshape/tst_qquickshape.cpp')
-rw-r--r--tests/auto/quick/qquickshape/tst_qquickshape.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickshape/tst_qquickshape.cpp b/tests/auto/quick/qquickshape/tst_qquickshape.cpp
index 174ada65a5..b3b8d2d148 100644
--- a/tests/auto/quick/qquickshape/tst_qquickshape.cpp
+++ b/tests/auto/quick/qquickshape/tst_qquickshape.cpp
@@ -59,6 +59,7 @@ private slots:
void radialGrad();
void conicalGrad();
void renderPolyline();
+ void renderMultiline();
};
tst_QQuickShape::tst_QQuickShape()
@@ -343,6 +344,35 @@ void tst_QQuickShape::renderPolyline()
QVERIFY2(res, qPrintable(errorMessage));
}
+void tst_QQuickShape::renderMultiline()
+{
+ QScopedPointer<QQuickView> window(createView());
+
+ window->setSource(testFileUrl("pathitem8.qml"));
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
+
+ if ((QGuiApplication::platformName() == QLatin1String("offscreen"))
+ || (QGuiApplication::platformName() == QLatin1String("minimal")))
+ QEXPECT_FAIL("", "Failure due to grabWindow not functional on offscreen/minimimal platforms", Abort);
+
+ QImage img = window->grabWindow();
+ QVERIFY(!img.isNull());
+
+ QImage refImg(testFileUrl("pathitem8.png").toLocalFile());
+ QVERIFY(!refImg.isNull());
+
+ QString errorMessage;
+ const QImage actualImg = img.convertToFormat(refImg.format());
+ const bool res = QQuickVisualTestUtil::compareImages(actualImg, refImg, &errorMessage);
+ if (!res) { // For visual inspection purposes.
+ QTest::qWait(5000);
+ const QString &tempLocation = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
+ actualImg.save(tempLocation + QLatin1String("/pathitem8.png"));
+ }
+ QVERIFY2(res, qPrintable(errorMessage));
+}
+
QTEST_MAIN(tst_QQuickShape)
#include "tst_qquickshape.moc"