aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/shared
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-03-06 18:47:17 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-11 22:16:36 +0100
commit8325f2dead9b5257113d260ab673d51f8891f097 (patch)
tree2d5e14247d80923328545bd380787e45cb7dbd2e /tests/auto/shared
parent457abe24baa709c55cf6d1951c7fb13400f0202e (diff)
Improve timer dependent tests.
tst_QQuickLoader::loadedSignal depended on sharing the engine with simultaneousSyncAsync and that function being run before it. After each test run call clearComponentCache() as that is important for caching of the network tests. The test server would send the item after 500ms. Sometimes the CI would be faster or slower. Instead of relying on timing, simply call a function when the reply should be sent. Change-Id: Ifb0447041197e1cba103570597a62a2510d31aab Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests/auto/shared')
-rw-r--r--tests/auto/shared/testhttpserver.cpp5
-rw-r--r--tests/auto/shared/testhttpserver.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/shared/testhttpserver.cpp b/tests/auto/shared/testhttpserver.cpp
index 461e0e70d2..205d5cec5d 100644
--- a/tests/auto/shared/testhttpserver.cpp
+++ b/tests/auto/shared/testhttpserver.cpp
@@ -284,6 +284,11 @@ bool TestHTTPServer::reply(QTcpSocket *socket, const QByteArray &fileName)
return true;
}
+void TestHTTPServer::sendDelayedItem()
+{
+ sendOne();
+}
+
void TestHTTPServer::sendOne()
{
if (!toSend.isEmpty()) {
diff --git a/tests/auto/shared/testhttpserver.h b/tests/auto/shared/testhttpserver.h
index 1abf37e438..15e08afd0c 100644
--- a/tests/auto/shared/testhttpserver.h
+++ b/tests/auto/shared/testhttpserver.h
@@ -64,6 +64,9 @@ public:
void addAlias(const QString &filename, const QString &aliasName);
void addRedirect(const QString &filename, const QString &redirectName);
+ // In Delay mode, each item needs one call to this function to be sent
+ void sendDelayedItem();
+
private slots:
void newConnection();
void disconnected();