diff options
Diffstat (limited to 'tests/auto/quick/qquickcanvasitem')
-rw-r--r-- | tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml | 2 | ||||
-rw-r--r-- | tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml b/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml index 1a5711ebb2..e299147b36 100644 --- a/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml +++ b/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml @@ -1,5 +1,6 @@ import QtQuick 2.0 import QtTest 1.0 +import QtQuick.Window 2.1 TestCase { id:testCase @@ -15,6 +16,7 @@ TestCase { if (type === "2d") return [ { tag:"image threaded", properties:{width:100, height:100, renderTarget:Canvas.Image, renderStrategy:Canvas.Threaded}}, + { tag:"image canvas invisible", properties:{visible: false, width:100, height:100, renderTarget:Canvas.Image, renderStrategy:Canvas.Threaded}}, // { tag:"image cooperative", properties:{width:100, height:100, renderTarget:Canvas.Image, renderStrategy:Canvas.Cooperative}}, { tag:"image immediate", properties:{width:100, height:100, renderTarget:Canvas.Image, renderStrategy:Canvas.Immediate}}, // { tag:"fbo cooperative", properties:{width:100, height:100, renderTarget:Canvas.FramebufferObject, renderStrategy:Canvas.Cooperative}}, diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml b/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml index f13039ad95..b92f6354a5 100644 --- a/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml +++ b/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml @@ -180,11 +180,20 @@ CanvasTestCase { tryCompare(c, "availableChangedCount", 1); //scene graph could be available immediately //in this case, we force waiting a short while until the init paint finished - tryCompare(c, "paintedCount", 1); + if (c.visible) { + tryCompare(c, "paintedCount", 1); + } else { + tryCompare(c, "paintedCount", 0); + } ctx.fillRect(0, 0, c.width, c.height); c.toDataURL(); - tryCompare(c, "paintedCount", 2); - tryCompare(c, "paintCount", 1); + if (c.visible) { + tryCompare(c, "paintCount", 1); + tryCompare(c, "paintedCount", 2); + } else { + tryCompare(c, "paintCount", 0); + tryCompare(c, "paintedCount", 1); + } c.destroy(); } function test_loadImage(row) { |