aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-15 17:53:16 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-22 18:37:52 +0200
commit0a1e4cc7ec7548f6273befff9cdddb0bc7a58961 (patch)
treebf8b7ae725ac332fa59bd9058cc479018aca147d /tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
parent4e266103ad8b75d71fb176a2f774faf71997123d (diff)
Do not resolve URLs when assigning them to a property
We don't know in advance if a URL is part of the source code and should be relative to the current element, or if it is part of the application data and should not be touched. [ChangeLog][QtQml][Important Behavior Changes] URLs are not resolved or intercepted anymore when assigning them to a "url" property. Instead they are resolved and possibly intercepted when used to access an actual resource. Fixes: QTBUG-76879 Change-Id: Iaa2385aff2c13aa71a12e57385d9afb5dc60a073 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlengine/tst_qqmlengine.cpp')
-rw-r--r--tests/auto/qml/qqmlengine/tst_qqmlengine.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
index 39e986f12a..ff8d6e2b2c 100644
--- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
+++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
@@ -799,7 +799,6 @@ void tst_qqmlengine::urlInterceptor_data()
{
QTest::addColumn<QUrl>("testFile");
QTest::addColumn<QList<QQmlAbstractUrlInterceptor::DataType> >("interceptionPoint");
- QTest::addColumn<QString>("expectedFilePath");
QTest::addColumn<QString>("expectedChildString");
QTest::addColumn<QString>("expectedScriptString");
QTest::addColumn<QString>("expectedResolvedUrl");
@@ -808,7 +807,6 @@ void tst_qqmlengine::urlInterceptor_data()
QTest::newRow("InterceptTypes")
<< testFileUrl("interception/types/urlInterceptor.qml")
<< (QList<QQmlAbstractUrlInterceptor::DataType>() << QQmlAbstractUrlInterceptor::QmlFile << QQmlAbstractUrlInterceptor::JavaScriptFile << QQmlAbstractUrlInterceptor::UrlString)
- << testFileUrl("interception/types/intercepted/doesNotExist.file").toString()
<< QStringLiteral("intercepted")
<< QStringLiteral("intercepted")
<< testFileUrl("interception/types/intercepted/doesNotExist.file").toString()
@@ -817,7 +815,6 @@ void tst_qqmlengine::urlInterceptor_data()
QTest::newRow("InterceptQmlDir")
<< testFileUrl("interception/qmldir/urlInterceptor.qml")
<< (QList<QQmlAbstractUrlInterceptor::DataType>() << QQmlAbstractUrlInterceptor::QmldirFile << QQmlAbstractUrlInterceptor::UrlString)
- << testFileUrl("interception/qmldir/intercepted/doesNotExist.file").toString()
<< QStringLiteral("intercepted")
<< QStringLiteral("base file")
<< testFileUrl("interception/qmldir/intercepted/doesNotExist.file").toString()
@@ -826,7 +823,6 @@ void tst_qqmlengine::urlInterceptor_data()
QTest::newRow("InterceptModule")//just a Test{}, needs to intercept the module import for it to work
<< testFileUrl("interception/module/urlInterceptor.qml")
<< (QList<QQmlAbstractUrlInterceptor::DataType>() << QQmlAbstractUrlInterceptor::QmldirFile )
- << testFileUrl("interception/module/intercepted/doesNotExist.file").toString()
<< QStringLiteral("intercepted")
<< QStringLiteral("intercepted")
<< testFileUrl("interception/module/intercepted/doesNotExist.file").toString()
@@ -835,7 +831,6 @@ void tst_qqmlengine::urlInterceptor_data()
QTest::newRow("InterceptStrings")
<< testFileUrl("interception/strings/urlInterceptor.qml")
<< (QList<QQmlAbstractUrlInterceptor::DataType>() << QQmlAbstractUrlInterceptor::UrlString)
- << testFileUrl("interception/strings/intercepted/doesNotExist.file").toString()
<< QStringLiteral("base file")
<< QStringLiteral("base file")
<< testFileUrl("interception/strings/intercepted/doesNotExist.file").toString()
@@ -844,7 +839,6 @@ void tst_qqmlengine::urlInterceptor_data()
QTest::newRow("InterceptIncludes")
<< testFileUrl("interception/includes/urlInterceptor.qml")
<< (QList<QQmlAbstractUrlInterceptor::DataType>() << QQmlAbstractUrlInterceptor::JavaScriptFile)
- << testFileUrl("interception/includes/doesNotExist.file").toString()
<< QStringLiteral("base file")
<< QStringLiteral("intercepted include file")
<< testFileUrl("interception/includes/doesNotExist.file").toString()
@@ -856,7 +850,6 @@ void tst_qqmlengine::urlInterceptor()
QFETCH(QUrl, testFile);
QFETCH(QList<QQmlAbstractUrlInterceptor::DataType>, interceptionPoint);
- QFETCH(QString, expectedFilePath);
QFETCH(QString, expectedChildString);
QFETCH(QString, expectedScriptString);
QFETCH(QString, expectedResolvedUrl);
@@ -873,7 +866,7 @@ void tst_qqmlengine::urlInterceptor()
qDebug() << c.errorString();
QVERIFY(o);
//Test a URL as a property initialization
- QCOMPARE(o->property("filePath").toString(), expectedFilePath);
+ QCOMPARE(o->property("filePath").toString(), QUrl("doesNotExist.file").toString());
//Test a URL as a Type location
QCOMPARE(o->property("childString").toString(), expectedChildString);
//Test a URL as a Script location