diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-22 17:15:30 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-04-25 12:02:55 +0000 |
commit | 79d56651edc05133ebae13bb93733373b10380f9 (patch) | |
tree | d60393857c0f1b28f9e34c55f4461e2f25c99a9e /tests/auto/shared/testhttpserver.h | |
parent | bfd596f36724029441d54095a126d25168e105c1 (diff) |
Prospective fix for flakey "network" related QML testsv5.4.2
Replace hard-coded server ports with dynamically allocated ports.
Change-Id: Iab8f9a88343a9f2c49af3cd700c954c13c3bf121
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'tests/auto/shared/testhttpserver.h')
-rw-r--r-- | tests/auto/shared/testhttpserver.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/shared/testhttpserver.h b/tests/auto/shared/testhttpserver.h index 829d8ac24a..ca5542087e 100644 --- a/tests/auto/shared/testhttpserver.h +++ b/tests/auto/shared/testhttpserver.h @@ -45,7 +45,10 @@ class TestHTTPServer : public QObject public: TestHTTPServer(); - bool listen(quint16 port); + bool listen(); + QUrl baseUrl() const; + QUrl url(const QString &documentPath) const; + QString urlString(const QString &documentPath) const; QString errorString() const; enum Mode { Normal, Delay, Disconnect }; @@ -57,6 +60,8 @@ public: void addAlias(const QString &filename, const QString &aliasName); void addRedirect(const QString &filename, const QString &redirectName); + void registerFileNameForContentSubstitution(const QString &fileName); + // In Delay mode, each item needs one call to this function to be sent void sendDelayedItem(); @@ -79,6 +84,7 @@ private: QList<QPair<QString, Mode> > dirs; QHash<QTcpSocket *, QByteArray> dataCache; QList<QPair<QTcpSocket *, QByteArray> > toSend; + QSet<QString> contentSubstitutedFileNames; struct WaitData { QList <QByteArray>headers; |