aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickpixmapcache
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2020-01-16 16:25:06 +0100
committerLeander Beernaert <leander.beernaert@qt.io>2020-01-16 16:25:06 +0100
commit1d333d3375874efb8d37df37dc5ef561573794ad (patch)
tree2d8c995f64c05c84c1fcceb2c5cb40fcae69855f /tests/auto/quick/qquickpixmapcache
parentb106d86c433706928b0b0c206a0d9f831681e1bf (diff)
parente79a2658cde899d6ee11ec3c0d0a3768eb2c864b (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Diffstat (limited to 'tests/auto/quick/qquickpixmapcache')
-rw-r--r--tests/auto/quick/qquickpixmapcache/data/asynchronousNoCache.qml17
-rw-r--r--tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp15
2 files changed, 29 insertions, 3 deletions
diff --git a/tests/auto/quick/qquickpixmapcache/data/asynchronousNoCache.qml b/tests/auto/quick/qquickpixmapcache/data/asynchronousNoCache.qml
new file mode 100644
index 0000000000..5331be5a15
--- /dev/null
+++ b/tests/auto/quick/qquickpixmapcache/data/asynchronousNoCache.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.12
+
+Item {
+ visible: true
+ width: 640
+ height: 480
+
+ Image{
+ asynchronous: true
+ anchors.fill: parent
+ fillMode: Image.Stretch
+ source: "exists1.png"
+ cache: false
+ sourceSize.width: width/2
+ sourceSize.height: height/2
+ }
+}
diff --git a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
index bffaaf7c6e..88cf6ece96 100644
--- a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
+++ b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
@@ -30,6 +30,7 @@
#include <QtQuick/private/qquickpixmapcache_p.h>
#include <QtQml/qqmlengine.h>
#include <QtQuick/qquickimageprovider.h>
+#include <QtQml/QQmlComponent>
#include <QNetworkReply>
#include "../../shared/util.h"
#include "testhttpserver.h"
@@ -62,6 +63,7 @@ private slots:
#endif
void lockingCrash();
void uncached();
+ void asynchronousNoCache();
#if PIXMAP_DATA_LEAK_TEST
void dataLeak();
#endif
@@ -431,7 +433,7 @@ void tst_qquickpixmapcache::uncached()
QUrl url("image://mypixmaps/mypix");
{
QQuickPixmap p;
- p.load(&engine, url, nullptr);
+ p.load(&engine, url, QQuickPixmap::Options{});
QImage img = p.image();
QCOMPARE(img.pixel(0,0), qRgb(255, 0, 0));
}
@@ -440,7 +442,7 @@ void tst_qquickpixmapcache::uncached()
MyPixmapProvider::fillColor = qRgb(0, 255, 0);
{
QQuickPixmap p;
- p.load(&engine, url, nullptr);
+ p.load(&engine, url, QQuickPixmap::Options{});
QImage img = p.image();
QCOMPARE(img.pixel(0,0), qRgb(0, 255, 0));
}
@@ -458,7 +460,7 @@ void tst_qquickpixmapcache::uncached()
MyPixmapProvider::fillColor = qRgb(255, 0, 255);
{
QQuickPixmap p;
- p.load(&engine, url, nullptr);
+ p.load(&engine, url, QQuickPixmap::Options{});
QImage img = p.image();
QCOMPARE(img.pixel(0,0), qRgb(255, 0, 255));
}
@@ -473,6 +475,13 @@ void tst_qquickpixmapcache::uncached()
}
}
+void tst_qquickpixmapcache::asynchronousNoCache()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("asynchronousNoCache.qml"));
+ QScopedPointer<QObject> root {component.create()}; // should not crash
+}
+
#if PIXMAP_DATA_LEAK_TEST
// This test should not be enabled by default as it