diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2019-08-05 13:27:16 +0200 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2019-08-13 11:38:14 +0200 |
commit | a9dad706a49444719c2c1a22867e9ef968841b1c (patch) | |
tree | eda896a7fe5e7b781416a17b080747b177e286ab /tests/auto/shared | |
parent | f7156b7de9afc0949cf89d868023c875805df248 (diff) |
Fix qqmlxmlhttprequest autotest for android
TestHTTPServer needs to convert QUrl to QStrings while also keeping
the resource information. (QUrl::toLocalFile() only converts to a local
file.)
Change-Id: I548a83f4db190efc89251a8335a52595829c5887
Task-number: QTBUG-73512
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/shared')
-rw-r--r-- | tests/auto/shared/testhttpserver.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/shared/testhttpserver.cpp b/tests/auto/shared/testhttpserver.cpp index 09f16e8635..f0d5a89984 100644 --- a/tests/auto/shared/testhttpserver.cpp +++ b/tests/auto/shared/testhttpserver.cpp @@ -32,6 +32,7 @@ #include <QFile> #include <QTimer> #include <QTest> +#include <QQmlFile> /*! \internal @@ -152,17 +153,17 @@ bool TestHTTPServer::wait(const QUrl &expect, const QUrl &reply, const QUrl &bod m_state = AwaitingHeader; m_data.clear(); - QFile expectFile(expect.toLocalFile()); + QFile expectFile(QQmlFile::urlToLocalFileOrQrc(expect)); if (!expectFile.open(QIODevice::ReadOnly)) return false; - QFile replyFile(reply.toLocalFile()); + QFile replyFile(QQmlFile::urlToLocalFileOrQrc(reply)); if (!replyFile.open(QIODevice::ReadOnly)) return false; m_bodyData = QByteArray(); if (body.isValid()) { - QFile bodyFile(body.toLocalFile()); + QFile bodyFile(QQmlFile::urlToLocalFileOrQrc(body)); if (!bodyFile.open(QIODevice::ReadOnly)) return false; m_bodyData = bodyFile.readAll(); |