summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2022-03-21 18:14:11 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-03-25 18:14:41 +0000
commite58f91dc78ebba1caf156ee46bb4ca2bf6272c02 (patch)
tree64be24cc233ba6a523c8197f6b4dc5978b61b9b3 /tests/auto
parent7c112f5c613cfc8a93ca3d85ccdab7a38b82a3c3 (diff)
Fix qimage compare in tst_webenginepage
After 019d0dd4 in qtbase comparing two images also checks a color space. Simply copy the color space for the comparison. Fixes: QTBUG-101935 Change-Id: I446ee21336e242443960dab7dd4d47681bd598d9 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io> (cherry picked from commit cddf9c264532105fc9d15d41cfd7585299ccab8f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index d95c246fc..9ddd1eedb 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -66,6 +66,7 @@
#include <qwebengineurlschemehandler.h>
#include <qwebengineview.h>
#include <qimagewriter.h>
+#include <QColorSpace>
static void removeRecursive(const QString& dirname)
{
@@ -520,6 +521,7 @@ void tst_QWebEnginePage::pasteImage()
QByteArray data = evaluateJavaScriptSync(page, "window.myImageDataURL").toByteArray();
data.remove(0, data.indexOf(";base64,") + 8);
QImage image = QImage::fromData(QByteArray::fromBase64(data), "PNG");
+ image.setColorSpace(origImage.colorSpace());
if (image.format() == QImage::Format_RGB32)
image.reinterpretAsFormat(QImage::Format_ARGB32);
QCOMPARE(image, origImage);