aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickshape/tst_qquickshape.cpp
diff options
context:
space:
mode:
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"