summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-06-25 12:12:55 +0200
committerJüri Valdmann <juri.valdmann@qt.io>2020-07-06 16:30:07 +0200
commit45e3909e0fb628b6283fef8ea94861b7ca87093b (patch)
treec6cc049d4b770c5fbc1ccc0d040221267718626c /tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
parent54d3437b7c7df8ba63929b6e1cfecc4be50d59f5 (diff)
Adapt to newer dependencies
Change-Id: I495880f56fbc10d8f332f26101f8a25c2a1c5631 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp')
-rw-r--r--tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
index 39948c211..6096d6345 100644
--- a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
+++ b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
@@ -902,7 +902,8 @@ void tst_QWebEngineDownloadItem::downloadUniqueFilename()
// Set up HTTP server
ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == ("/" + fileName)) {
+ auto requestPath = QString::fromUtf8(rr->requestPath());
+ if (rr->requestMethod() == "GET" && requestPath == ("/" + fileName)) {
rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
rr->setResponseBody(QByteArrayLiteral("a"));
@@ -960,7 +961,8 @@ void tst_QWebEngineDownloadItem::downloadUniqueFilenameWithTimestamp()
m_profile->setDownloadPath(tmpDir.path());
ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == ("/" + fileName)) {
+ auto requestPath = QString::fromUtf8(rr->requestPath());
+ if (rr->requestMethod() == "GET" && requestPath == ("/" + fileName)) {
rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
rr->setResponseBody(QByteArrayLiteral("a"));
@@ -1056,7 +1058,8 @@ void tst_QWebEngineDownloadItem::downloadToNonExistentDir()
// Set up HTTP server
ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == ("/" + fileName)) {
+ auto requestPath = QString::fromUtf8(rr->requestPath());
+ if (rr->requestMethod() == "GET" && requestPath == ("/" + fileName)) {
rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
rr->setResponseBody(QByteArrayLiteral("a"));
@@ -1113,7 +1116,8 @@ void tst_QWebEngineDownloadItem::downloadToReadOnlyDir()
// Set up HTTP server
ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == ("/" + fileName)) {
+ auto requestPath = QString::fromUtf8(rr->requestPath());
+ if (rr->requestMethod() == "GET" && requestPath == ("/" + fileName)) {
rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
rr->setResponseBody(QByteArrayLiteral("a"));
@@ -1168,7 +1172,8 @@ void tst_QWebEngineDownloadItem::downloadPathValidation()
// Set up HTTP server
ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == ("/" + fileName)) {
+ auto requestPath = QString::fromUtf8(rr->requestPath());
+ if (rr->requestMethod() == "GET" && requestPath == ("/" + fileName)) {
rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
rr->setResponseBody(QByteArrayLiteral("a"));
@@ -1300,7 +1305,8 @@ void tst_QWebEngineDownloadItem::downloadToDirectoryWithFileName()
// Set up HTTP server
ScopedConnection sc1 = connect(m_server, &HttpServer::newRequest, [&](HttpReqRep *rr) {
- if (rr->requestMethod() == "GET" && rr->requestPath() == ("/" + fileName)) {
+ auto requestPath = QString::fromUtf8(rr->requestPath());
+ if (rr->requestMethod() == "GET" && requestPath == ("/" + fileName)) {
rr->setResponseHeader(QByteArrayLiteral("content-type"), QByteArrayLiteral("application/octet-stream"));
rr->setResponseHeader(QByteArrayLiteral("content-disposition"), QByteArrayLiteral("attachment"));
rr->setResponseBody(QByteArrayLiteral("a"));