diff options
Diffstat (limited to 'tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml')
-rw-r--r-- | tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml b/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml index 53ed3658c2..f7e708e7aa 100644 --- a/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml +++ b/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml @@ -40,13 +40,17 @@ Item { when: imageOnDisk.ready && imageOnDiskSmall.ready function test_endresult_disk() { + if ((Qt.platform.pluginName === "offscreen") + || (Qt.platform.pluginName === "minimal")) + skip("grabImage does not work on offscreen/minimal platforms"); + var image = grabImage(root); // imageOnDisk at (0, 0) - (100x100) compare(imageOnDisk.width, 100); compare(imageOnDisk.height, 100); - verify(image.pixel(0, 0) === Qt.rgba(1, 0, 0, 1)); // Use verify because compare doesn't support colors (QTBUG-34878) - verify(image.pixel(99, 99) === Qt.rgba(0, 0, 1, 1)); + compare(image.pixel(0, 0), Qt.rgba(1, 0, 0, 1)); + compare(image.pixel(99, 99), Qt.rgba(0, 0, 1, 1)); // imageOnDiskSmall at (100, 0) - 50x50 compare(imageOnDiskSmall.width, 50); @@ -73,6 +77,10 @@ Item { } function test_endresult_cache(data) { + if ((Qt.platform.pluginName === "offscreen") + || (Qt.platform.pluginName === "minimal")) + skip("grabImage does not work on offscreen/minimal platforms"); + imageInCache.cache = data.cache; imageInCache.sourceSize = data.sourceSize; imageInCache.fillMode = data.fillMode; @@ -91,8 +99,8 @@ Item { // imageInCache at (0, 100) - 100x100 compare(imageInCache.width, 100); compare(imageInCache.height, 100); - verify(image.pixel(0, 100) === Qt.rgba(1, 0, 0, 1)); - verify(image.pixel(99, 199) === Qt.rgba(0, 0, 1, 1)); + compare(image.pixel(0, 100), Qt.rgba(1, 0, 0, 1)); + compare(image.pixel(99, 199), Qt.rgba(0, 0, 1, 1)); // imageInCacheSmall at (100, 100) - 50x50 compare(imageInCacheSmall.width, 50); |