summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmllanguage
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-10-27 06:29:16 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-10-27 06:29:16 (GMT)
commitfc4dd3eab91fc1959e216a754620a96cf05932d7 (patch)
treef4ad131a496fbc1cb5e1d99ea088953d9e8875a2 /tests/auto/declarative/qmllanguage
parent39d8429b22d71786214e2b1ed7972f22d96fdfd1 (diff)
downloadQt-fc4dd3eab91fc1959e216a754620a96cf05932d7.zip
Qt-fc4dd3eab91fc1959e216a754620a96cf05932d7.tar.gz
Qt-fc4dd3eab91fc1959e216a754620a96cf05932d7.tar.bz2
Test remote QML content
(test data will appear on qt-test-server.qt-test-net shortly)
Diffstat (limited to 'tests/auto/declarative/qmllanguage')
-rw-r--r--tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
index d51bbcc..1544312 100644
--- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
+++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
@@ -7,6 +7,9 @@
#include <QtCore/qdir.h>
#include "testtypes.h"
+#include "../../../shared/util.h"
+#include "../../network-settings.h"
+
/*
This test case covers QML language issues. This covers everything that does
involve evaluating ECMAScript expressions and bindings.
@@ -69,6 +72,8 @@ private slots:
void importsBuiltin();
void importsLocal_data();
void importsLocal();
+ void importsRemote_data();
+ void importsRemote();
void importsInstalled_data();
void importsInstalled();
void importsOrder_data();
@@ -773,6 +778,8 @@ void tst_qmllanguage::testType(const QString& qml, const QString& type)
{
QmlComponent component(&engine, qml.toUtf8(), TEST_FILE("empty.qml")); // just a file for relative local imports
+ QTRY_VERIFY(!component.isLoading());
+
if (type.isEmpty()) {
QVERIFY(component.isError());
} else {
@@ -927,6 +934,27 @@ void tst_qmllanguage::importsLocal()
testType(qml,type);
}
+void tst_qmllanguage::importsRemote_data()
+{
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QString>("type");
+
+ QString serverdir = "http://"
+ + QtNetworkSettings::serverName()
+ + "/qtest/declarative/qmllanguage";
+
+ QTest::newRow("remote import") << "import \""+serverdir+"\"\nTest {}" << "QFxRect";
+ QTest::newRow("remote import with subdir") << "import \""+serverdir+"\"\nTestSubDir {}" << "QFxText";
+ QTest::newRow("remote import with local") << "import \""+serverdir+"\"\nTestLocal {}" << "QFxImage";
+}
+
+void tst_qmllanguage::importsRemote()
+{
+ QFETCH(QString, qml);
+ QFETCH(QString, type);
+ testType(qml,type);
+}
+
void tst_qmllanguage::importsInstalled_data()
{
QTest::addColumn<QString>("qml");