1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
import QtQuick 2.0 import QtTest 1.1 Canvas { id: canvas width: 1 height: 1 contextType: "2d" property var contextInPaint onPaint: { contextInPaint = context; } TestCase { name: "ContextTypeStored" when: windowShown function test_contextType() { compare(canvas.contextType, "2d"); } } }