aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
index a790c7b9de..3eea3c955c 100644
--- a/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
+++ b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
@@ -71,6 +71,9 @@ private slots:
void removeProvider_data();
void removeProvider();
+ void imageProviderId_data();
+ void imageProviderId();
+
void threadTest();
private:
@@ -372,6 +375,31 @@ void tst_qquickimageprovider::removeProvider()
delete obj;
}
+void tst_qquickimageprovider::imageProviderId_data()
+{
+ QTest::addColumn<QString>("providerId");
+
+ QTest::newRow("lowercase") << QStringLiteral("imageprovider");
+ QTest::newRow("CamelCase") << QStringLiteral("ImageProvider");
+ QTest::newRow("UPPERCASE") << QStringLiteral("IMAGEPROVIDER");
+}
+
+void tst_qquickimageprovider::imageProviderId()
+{
+ QFETCH(QString, providerId);
+
+ QQmlEngine engine;
+
+ bool deleteWatch = false;
+ TestQImageProvider *provider = new TestQImageProvider(&deleteWatch);
+
+ engine.addImageProvider(providerId, provider);
+ QVERIFY(engine.imageProvider(providerId) != 0);
+
+ engine.removeImageProvider(providerId);
+ QVERIFY(deleteWatch);
+}
+
class TestThreadProvider : public QQuickImageProvider
{
public: