aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp')
-rw-r--r--tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp b/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp
index 4c99bcf9c8..fe55d8b056 100644
--- a/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp
+++ b/tests/auto/qml/qqmlfileselector/tst_qqmlfileselector.cpp
@@ -47,7 +47,7 @@ private slots:
void basicTest();
void basicTestCached();
void applicationEngineTest();
-
+ void qmldirCompatibility();
};
void tst_qqmlfileselector::basicTest()
@@ -95,6 +95,23 @@ void tst_qqmlfileselector::applicationEngineTest()
QCOMPARE(object->property("value").toString(), QString("selected"));
}
+void tst_qqmlfileselector::qmldirCompatibility()
+{
+ QQmlApplicationEngine engine;
+ engine.addImportPath(dataDirectory());
+ engine.load(testFileUrl("qmldirtest/main.qml"));
+ QVERIFY(!engine.rootObjects().isEmpty());
+ QObject *object = engine.rootObjects().at(0);
+ auto color = object->property("color").value<QColor>();
+#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
+ QCOMPARE(color, QColorConstants::Svg::blue);
+#elif defined(Q_OS_DARWIN)
+ QCOMPARE(color, QColorConstants::Svg::yellow);
+#else
+ QCOMPARE(color, QColorConstants::Svg::green);
+#endif
+}
+
QTEST_MAIN(tst_qqmlfileselector)
#include "tst_qqmlfileselector.moc"