From 422c35b0938389e701fb12286d21be8ed8874809 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Fri, 23 Apr 2021 09:38:14 +0200 Subject: 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 (cherry picked from commit b8451949ba375ecf253fe07a3e043d83d00f9b74) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v1.2.3