diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-09-12 18:29:45 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-09-12 18:29:45 +0300 |
commit | da0aac1057552048f59075beb31861a6cc076684 (patch) | |
tree | 020cd8784f01248ea051bbf70254b8bcb3100a23 /tests/auto/qmltest/selftests/tst_grabImage.qml | |
parent | f274d775774b78f6217c9770ae87045d969acbe1 (diff) | |
parent | 4757cac470edbeaeaceca4e63075d9f1139f546b (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.7' into tqtc/lts-5.15-opensourcev5.15.7-lts-lgpl
Change-Id: I658cff3c394ed233005efe6b12c515d2a886ef6b
Diffstat (limited to 'tests/auto/qmltest/selftests/tst_grabImage.qml')
-rw-r--r-- | tests/auto/qmltest/selftests/tst_grabImage.qml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/qmltest/selftests/tst_grabImage.qml b/tests/auto/qmltest/selftests/tst_grabImage.qml index 7ce7e93a07..714bc07f27 100644 --- a/tests/auto/qmltest/selftests/tst_grabImage.qml +++ b/tests/auto/qmltest/selftests/tst_grabImage.qml @@ -34,6 +34,7 @@ TestCase { id: testCase name: "tst_grabImage" when: windowShown + visible: true function test_equals() { var rect = createTemporaryQmlObject("import QtQuick 2.0; Rectangle { color: 'red'; width: 10; height: 10; }", testCase); @@ -47,6 +48,8 @@ TestCase { // Don't change anything... newImage = grabImage(rect); try { + // Check that we actually grabbed something + compare(newImage.pixel(0, 0), "#ff0000") compare(newImage.size, oldImage.size); verify(newImage.equals(oldImage)); } catch (ex) { @@ -86,6 +89,8 @@ TestCase { try { verify(grabbedImage2.equals(grabbedImage)) + // Check that we actually grabbed, saved, and loaded something + compare(grabbedImage2.pixel(0, 0), "#ff0000") } catch (ex) { grabbedImage2.save("tst_grabImage_test_save2.png") throw ex; |