summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
diff options
context:
space:
mode:
authorJustin McPherson <justin.mcpherson@nokia.com>2010-04-15 09:10:43 (GMT)
committerJustin McPherson <justin.mcpherson@nokia.com>2010-04-15 09:10:43 (GMT)
commit06d71fb79ad850c62a1b95fbeec607dfc4220489 (patch)
tree78698d4ab162020c725ed06fa73aa27776f3e5ec /tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
parente85223d233c0e1d6beca748332b8fbaba3ebbf2d (diff)
parent2b768dc774a5a957e7806515db3c7976bb9e337c (diff)
downloadQt-06d71fb79ad850c62a1b95fbeec607dfc4220489.zip
Qt-06d71fb79ad850c62a1b95fbeec607dfc4220489.tar.gz
Qt-06d71fb79ad850c62a1b95fbeec607dfc4220489.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.7
Diffstat (limited to 'tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp57
1 files changed, 46 insertions, 11 deletions
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index bfb56ba..7c327c2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -52,6 +52,7 @@
#include "testtypes.h"
#include "../../../shared/util.h"
+#include "testhttpserver.h"
/*
This test case covers QML language issues. This covers everything that does not
@@ -116,6 +117,8 @@ private slots:
void defaultPropertyListOrder();
void declaredPropertyValues();
+ void basicRemote_data();
+ void basicRemote();
void importsBuiltin_data();
void importsBuiltin();
void importsLocal_data();
@@ -1254,12 +1257,12 @@ void tst_qdeclarativelanguage::importsLocal_data()
<< "QDeclarativeRectangle"
<< "";
QTest::newRow("local import second")
- << "import Qt 4.6\nimport \"subdir\"\n"
+ << "import Qt 4.7\nimport \"subdir\"\n"
"Test {}"
<< "QDeclarativeRectangle"
<< "";
QTest::newRow("local import subsubdir")
- << "import Qt 4.6\nimport \"subdir/subsubdir\"\n"
+ << "import Qt 4.7\nimport \"subdir/subsubdir\"\n"
"SubTest {}"
<< "QDeclarativeRectangle"
<< "";
@@ -1298,13 +1301,47 @@ void tst_qdeclarativelanguage::importsLocal()
testType(qml,type,error);
}
+void tst_qdeclarativelanguage::basicRemote_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<QString>("type");
+ QTest::addColumn<QString>("error");
+
+ QString serverdir = "http://127.0.0.1:14447/qtest/declarative/qmllanguage/";
+
+ QTest::newRow("no need for qmldir") << QUrl(serverdir+"Test.qml") << "" << "";
+ QTest::newRow("need qmldir") << QUrl(serverdir+"TestLocal.qml") << "" << "";
+}
+
+void tst_qdeclarativelanguage::basicRemote()
+{
+ QFETCH(QUrl, url);
+ QFETCH(QString, type);
+ QFETCH(QString, error);
+
+ TestHTTPServer server(14447);
+ server.serveDirectory(SRCDIR);
+
+ QDeclarativeComponent component(&engine, url);
+
+ QTRY_VERIFY(!component.isLoading());
+
+ if (error.isEmpty()) {
+ if (component.isError())
+ qDebug() << component.errors();
+ QVERIFY(!component.isError());
+ } else {
+ QVERIFY(component.isError());
+ }
+}
+
void tst_qdeclarativelanguage::importsRemote_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<QString>("type");
QTest::addColumn<QString>("error");
- QString serverdir = "http://127.0.0.1:14445/qtest/declarative/qmllanguage";
+ QString serverdir = "http://127.0.0.1:14447/qtest/declarative/qmllanguage";
QTest::newRow("remote import") << "import \""+serverdir+"\"\nTest {}" << "QDeclarativeRectangle"
<< "";
@@ -1320,15 +1357,13 @@ void tst_qdeclarativelanguage::importsRemote_data()
<< "UndeclaredLocal is not a type";
}
-#include "testhttpserver.h"
-
void tst_qdeclarativelanguage::importsRemote()
{
QFETCH(QString, qml);
QFETCH(QString, type);
QFETCH(QString, error);
- TestHTTPServer server(14445);
+ TestHTTPServer server(14447);
server.serveDirectory(SRCDIR);
testType(qml,type,error);
@@ -1430,24 +1465,24 @@ void tst_qdeclarativelanguage::importsOrder_data()
QTest::newRow("installed import versus builtin 1") <<
"import com.nokia.installedtest 1.5\n"
- "import Qt 4.6\n"
+ "import Qt 4.7\n"
"Rectangle {}"
<< "QDeclarativeRectangle"
<< "";
QTest::newRow("installed import versus builtin 2") <<
- "import Qt 4.6\n"
+ "import Qt 4.7\n"
"import com.nokia.installedtest 1.5\n"
"Rectangle {}"
<< "QDeclarativeText"
<< "";
QTest::newRow("namespaces cannot be overridden by types 1") <<
- "import Qt 4.6 as Rectangle\n"
+ "import Qt 4.7 as Rectangle\n"
"import com.nokia.installedtest 1.5\n"
"Rectangle {}"
<< ""
<< "Namespace Rectangle cannot be used as a type";
QTest::newRow("namespaces cannot be overridden by types 2") <<
- "import Qt 4.6 as Rectangle\n"
+ "import Qt 4.7 as Rectangle\n"
"import com.nokia.installedtest 1.5\n"
"Rectangle.Image {}"
<< "QDeclarativeImage"
@@ -1502,7 +1537,7 @@ void tst_qdeclarativelanguage::qmlAttachedPropertiesObjectMethod()
void tst_qdeclarativelanguage::crash1()
{
QDeclarativeComponent component(&engine);
- component.setData("import Qt 4.6\nComponent {}", QUrl());
+ component.setData("import Qt 4.7\nComponent {}", QUrl());
}
void tst_qdeclarativelanguage::crash2()