diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-04-23 09:38:14 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-04-23 13:43:47 +0000 |
commit | 5d55b0ee58100c134fe7531ead1ca08a3ea4d6de (patch) | |
tree | 03013741910dd23b4152f55f517496dbff8465a9 | |
parent | 5b0a4213ce2fcd38e7a818fdc48635e7c19014e0 (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.qml | 2 |
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; |