diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-06-25 12:12:55 +0200 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2020-07-06 16:30:07 +0200 |
commit | 45e3909e0fb628b6283fef8ea94861b7ca87093b (patch) | |
tree | c6cc049d4b770c5fbc1ccc0d040221267718626c /tests/auto | |
parent | 54d3437b7c7df8ba63929b6e1cfecc4be50d59f5 (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')
6 files changed, 25 insertions, 17 deletions
diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp index 5ee30f165..6f78ddc4c 100644 --- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp +++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp @@ -584,7 +584,7 @@ void tst_QQuickWebEngineView::interruptImeTextComposition() QTest::mouseClick(view->window(), Qt::LeftButton, {}, textInputCenter); } else if (eventType == "Touch") { QPoint textInputCenter = elementCenter(view, QStringLiteral("input2")); - QTouchDevice *touchDevice = QTest::createTouchDevice(); + QPointingDevice *touchDevice = QTest::createTouchDevice(); QTest::touchEvent(view->window(), touchDevice).press(0, textInputCenter, view->window()); QTest::touchEvent(view->window(), touchDevice).release(0, textInputCenter, view->window()); } @@ -975,9 +975,7 @@ void tst_QQuickWebEngineView::inputEventForwardingDisabledWhenActiveFocusOnPress QTest::mousePress(view->window(), Qt::LeftButton); QTest::mouseRelease(view->window(), Qt::LeftButton); - QTouchDevice *device = new QTouchDevice; - device->setType(QTouchDevice::TouchScreen); - QWindowSystemInterface::registerTouchDevice(device); + QPointingDevice *device = QTest::createTouchDevice(); QTest::touchEvent(view->window(), device).press(0, QPoint(0,0), view->window()); QTest::touchEvent(view->window(), device).move(0, QPoint(1, 1), view->window()); diff --git a/tests/auto/shared/httpsserver.h b/tests/auto/shared/httpsserver.h index 32c8e8345..219d5f7a1 100644 --- a/tests/auto/shared/httpsserver.h +++ b/tests/auto/shared/httpsserver.h @@ -55,7 +55,7 @@ struct SslTcpServer : QTcpServer return; } - connect(socket, QOverload<QSslSocket::SocketError>::of(&QSslSocket::error), + connect(socket, QOverload<QSslSocket::SocketError>::of(&QSslSocket::errorOccurred), [] (QSslSocket::SocketError e) { qWarning() << "! Socket Error:" << e; }); connect(socket, QOverload<const QList<QSslError> &>::of(&QSslSocket::sslErrors), [] (const QList<QSslError> &le) { qWarning() << "! SSL Errors:\n" << le; }); diff --git a/tests/auto/widgets/proxy/proxy_server.cpp b/tests/auto/widgets/proxy/proxy_server.cpp index 3bf915609..3e52de4f2 100644 --- a/tests/auto/widgets/proxy/proxy_server.cpp +++ b/tests/auto/widgets/proxy/proxy_server.cpp @@ -39,7 +39,7 @@ ProxyServer::ProxyServer(QObject *parent) : QObject(parent) void ProxyServer::setCredentials(const QByteArray &user, const QByteArray password) { m_auth.append(user); - m_auth.append(QChar(':')); + m_auth.append(':'); m_auth.append(password); m_auth = m_auth.toBase64(); m_authenticate = true; 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")); diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 16670ff30..72c580034 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -2019,7 +2019,7 @@ private Q_SLOTS: void continueError() { - emit error(this->error()); + emit errorOccurred(this->error()); emit finished(); } }; @@ -2378,9 +2378,13 @@ void tst_QWebEnginePage::setContent_data() QString str = QString::fromUtf8("ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει"); QTest::newRow("UTF-8 plain text") << "text/plain; charset=utf-8" << str.toUtf8() << str; - QTextCodec *utf16 = QTextCodec::codecForName("UTF-16"); - if (utf16) - QTest::newRow("UTF-16 plain text") << "text/plain; charset=utf-16" << utf16->fromUnicode(str) << str; + QBuffer out16; + out16.open(QIODevice::WriteOnly); + QTextStream stream16(&out16); + stream16.setEncoding(QStringConverter::Utf16); + stream16 << str; + stream16.flush(); + QTest::newRow("UTF-16 plain text") << "text/plain; charset=utf-16" << out16.buffer() << str; str = QString::fromUtf8("Une chaîne de caractères à sa façon."); QTest::newRow("latin-1 plain text") << "text/plain; charset=iso-8859-1" << str.toLatin1() << str; diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp index d5a2ecf49..c5d3f2eed 100644 --- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp +++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp @@ -60,7 +60,7 @@ do { \ QCOMPARE((__expr), __expected); \ } while (0) -static QTouchDevice* s_touchDevice = nullptr; +static QPointingDevice* s_touchDevice = nullptr; static QPoint elementCenter(QWebEnginePage *page, const QString &id) { |