summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-03-24 04:07:26 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-03-24 04:07:26 (GMT)
commit562ff1d1fcb726932aa4483655aa0d4c6a9746f2 (patch)
tree458e725c4431493bf8433df435b483f97a115bec /tests/auto
parentd33d30719d3c17fc1505e1b508999c76c6abc6b4 (diff)
downloadQt-562ff1d1fcb726932aa4483655aa0d4c6a9746f2.zip
Qt-562ff1d1fcb726932aa4483655aa0d4c6a9746f2.tar.gz
Qt-562ff1d1fcb726932aa4483655aa0d4c6a9746f2.tar.bz2
Revert 95aa8c8fc76e2309a629b05994a2677b0887140b.
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp43
-rw-r--r--tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp37
2 files changed, 1 insertions, 79 deletions
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index b6bd3f8..72b6b28 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -53,19 +53,6 @@
#include "../../../shared/util.h"
-class SafeLocalhostDeclarativeEngine : public QDeclarativeEngine {
-public:
- SafeLocalhostDeclarativeEngine() : QDeclarativeEngine() {}
-
- virtual bool isSafeOrigin(const QUrl& to_url, const QUrl& from_url) const
- {
- if (to_url.host() == "127.0.0.1")
- return true;
- else
- return QDeclarativeEngine::isSafeOrigin(to_url,from_url);
- }
-};
-
/*
This test case covers QML language issues. This covers everything that does not
involve evaluating ECMAScript expressions and bindings.
@@ -134,7 +121,6 @@ private slots:
void importsLocal();
void importsRemote_data();
void importsRemote();
- void importsUnsafe();
void importsInstalled_data();
void importsInstalled();
void importsOrder_data();
@@ -149,7 +135,7 @@ private slots:
void crash2();
private:
- SafeLocalhostDeclarativeEngine engine;
+ QDeclarativeEngine engine;
void testType(const QString& qml, const QString& type);
};
@@ -1276,33 +1262,6 @@ void tst_qdeclarativelanguage::importsRemote()
testType(qml,type);
}
-void tst_qdeclarativelanguage::importsUnsafe()
-{
- TestHTTPServer server(14445);
- server.serveDirectory(SRCDIR);
-
- QString qml = "import \"http://127.0.0.1:14445/qtest/declarative/qmllanguage\"\n\nTest {}";
-
- {
- QDeclarativeEngine engine; // plain engine without special localhost handling
- QDeclarativeComponent component(&engine);
- component.setData(qml.toUtf8(), TEST_FILE("empty.qml")); // just a file for relative local imports
-
- QTRY_VERIFY(!component.isLoading());
-
- QVERIFY(component.isError());
- }
-
- {
- QDeclarativeComponent component(&engine); // engine special localhost handling
- component.setData(qml.toUtf8(), TEST_FILE("empty.qml")); // just a file for relative local imports
-
- QTRY_VERIFY(!component.isLoading());
-
- QVERIFY(!component.isError());
- }
-}
-
void tst_qdeclarativelanguage::importsInstalled_data()
{
// QT-610
diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
index 506e1ee..c3be943 100644
--- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
+++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
@@ -86,8 +86,6 @@ private slots:
void noResizeGraphicsWidget();
void networkRequestUrl();
void failNetworkRequest();
- void networkSafety();
- void networkSafety_data();
// void networkComponent();
void deleteComponentCrash();
@@ -508,41 +506,6 @@ void tst_QDeclarativeLoader::vmeErrors()
delete loader;
}
-void tst_QDeclarativeLoader::networkSafety_data()
-{
- QTest::addColumn<QUrl>("url");
- QTest::addColumn<QString>("message");
-
- QTest::newRow("same origin") << QUrl("http://127.0.0.1:14445/sameorigin.qml") << QString();
- QTest::newRow("different origin") << QUrl("http://127.0.0.1:14445/differentorigin.qml") << QString("QML Loader (http://127.0.0.1:14445/differentorigin.qml:3:1) \"http://evil.place/evil.qml\" is not a safe origin from \"http://127.0.0.1:14445/differentorigin.qml\"");
-}
-
-void tst_QDeclarativeLoader::networkSafety()
-{
- TestHTTPServer server(SERVER_PORT);
- QVERIFY(server.isValid());
- server.serveDirectory(SRCDIR "/data");
-
- QFETCH(QUrl, url);
- QFETCH(QString, message);
-
- if (!message.isEmpty())
- QTest::ignoreMessage(QtWarningMsg, message.toLatin1());
-
- QDeclarativeComponent component(&engine, url);
- TRY_WAIT(component.status() == QDeclarativeComponent::Ready);
- QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
- QVERIFY(loader != 0);
-
- if (message.isEmpty()) {
- TRY_WAIT(loader->status() == QDeclarativeLoader::Ready);
- } else {
- TRY_WAIT(loader->status() == QDeclarativeLoader::Null);
- }
-
- delete loader;
-}
-
QTEST_MAIN(tst_QDeclarativeLoader)
#include "tst_qdeclarativeloader.moc"