summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-04-23 09:38:14 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-23 13:43:46 +0000
commit422c35b0938389e701fb12286d21be8ed8874809 (patch)
tree06bb66d75e26755ce396417b4b74bd597c270863
parenta024645d322f5a63aec07926b64b65e97cdca398 (diff)
tst_qquickcanvas: Verfiy that canvas.context exists
Apparently it was possible to execute the pixel check before the canvas was fully created. Use tryVerify to ensure that it is actually is there before running the actual test function. Change-Id: I8e9f1133ea718c001f0456cb3af27f13e6d85e96 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit b8451949ba375ecf253fe07a3e043d83d00f9b74) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml b/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
index d74df3daa7..43e26583ff 100644
--- a/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
@@ -673,6 +673,8 @@ CanvasTestCase {
function test_implicitlySizedParent() {
var implicitlySizedItem = implicitlySizedComponent.createObject(container);
verify(implicitlySizedItem);
+ tryVerify(() => implicitlySizedItem.canvas)
+ tryVerify(() => implicitlySizedItem.canvas.context)
var xCenter = implicitlySizedItem.width / 2;
var yCenter = implicitlySizedItem.height / 2;