diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-04-05 13:46:53 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-04-05 13:46:53 +0200 |
commit | 7e5c64b6badc6bda3991a1f016392c850f86640d (patch) | |
tree | 06b1110094886cff579cf0d4b731e1d52fed0f1f /tests/auto/quick | |
parent | f962cadf8dd0a7aee59573896148c0ea96bd5503 (diff) | |
parent | d2fa5fd0f5b1972bd372510cc14509e85b972b23 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I8f0fa53b1e202d1932008291ea786a4ed1a49a64
Diffstat (limited to 'tests/auto/quick')
-rw-r--r-- | tests/auto/quick/dialogs/BLACKLIST | 2 | ||||
-rw-r--r-- | tests/auto/quick/dialogs/server.cpp | 13 | ||||
-rw-r--r-- | tests/auto/quick/dialogs/server.h | 2 | ||||
-rw-r--r-- | tests/auto/quick/dialogs/tst_dialogs.cpp | 17 | ||||
-rw-r--r-- | tests/auto/quick/publicapi/tst_publicapi.cpp | 3 | ||||
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_notification.qml | 2 | ||||
-rw-r--r-- | tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp | 2 | ||||
-rw-r--r-- | tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp | 2 |
8 files changed, 25 insertions, 18 deletions
diff --git a/tests/auto/quick/dialogs/BLACKLIST b/tests/auto/quick/dialogs/BLACKLIST deleted file mode 100644 index 19380e01e..000000000 --- a/tests/auto/quick/dialogs/BLACKLIST +++ /dev/null @@ -1,2 +0,0 @@ -[authenticationDialogRequested:Proxy Authentication Dialog] -* diff --git a/tests/auto/quick/dialogs/server.cpp b/tests/auto/quick/dialogs/server.cpp index dc9cfe582..dfc7c97ad 100644 --- a/tests/auto/quick/dialogs/server.cpp +++ b/tests/auto/quick/dialogs/server.cpp @@ -33,7 +33,6 @@ Server::Server(QObject *parent) : QObject(parent) { - m_data.clear(); connect(&m_server, &QTcpServer::newConnection, this, &Server::handleNewConnection); } @@ -42,6 +41,11 @@ bool Server::isListening() return m_server.isListening(); } +void Server::setReply(const QByteArray &reply) +{ + m_reply = reply; +} + void Server::run() { if (!m_server.listen(QHostAddress::LocalHost, 5555)) @@ -69,12 +73,7 @@ void Server::handleReadReady() if (!m_data.endsWith("\r\n\r\n")) return; - if (m_data.contains(QByteArrayLiteral("OPEN_AUTH"))) - socket->write("HTTP/1.1 401 Unauthorized\nWWW-Authenticate: " - "Basic realm=\"Very Restricted Area\"\r\n\r\n"); - if (m_data.contains(QByteArrayLiteral("OPEN_PROXY"))) - socket->write("HTTP/1.1 407 Proxy Auth Required\nProxy-Authenticate: " - "Basic realm=\"Proxy requires authentication\"\r\n\r\n"); + socket->write(m_reply); m_data.clear(); socket->disconnectFromHost(); } diff --git a/tests/auto/quick/dialogs/server.h b/tests/auto/quick/dialogs/server.h index 24da47523..fa9a73811 100644 --- a/tests/auto/quick/dialogs/server.h +++ b/tests/auto/quick/dialogs/server.h @@ -40,6 +40,7 @@ public: explicit Server(QObject *parent = nullptr); bool isListening(); + void setReply(const QByteArray &reply); public slots: void run(); @@ -50,6 +51,7 @@ private slots: private: QByteArray m_data; + QByteArray m_reply; QTcpServer m_server; }; diff --git a/tests/auto/quick/dialogs/tst_dialogs.cpp b/tests/auto/quick/dialogs/tst_dialogs.cpp index cecea1831..26a0fe034 100644 --- a/tests/auto/quick/dialogs/tst_dialogs.cpp +++ b/tests/auto/quick/dialogs/tst_dialogs.cpp @@ -145,12 +145,19 @@ void tst_Dialogs::authenticationDialogRequested_data() QTest::addColumn<QUrl>("url"); QTest::addColumn<QQuickWebEngineAuthenticationDialogRequest::AuthenticationType>("type"); QTest::addColumn<QString>("realm"); - QTest::newRow("Http Authentication Dialog") << QUrl("http://localhost:5555/OPEN_AUTH") + QTest::addColumn<QByteArray>("reply"); + QTest::newRow("Http Authentication Dialog") << QUrl("http://localhost:5555/") << QQuickWebEngineAuthenticationDialogRequest::AuthenticationTypeHTTP - << QStringLiteral("Very Restricted Area"); - QTest::newRow("Proxy Authentication Dialog") << QUrl("http://localhost.:5555/OPEN_PROXY") + << QStringLiteral("Very Restricted Area") + << QByteArrayLiteral("HTTP/1.1 401 Unauthorized\nWWW-Authenticate: " + "Basic realm=\"Very Restricted Area\"\r\n\r\n"); + QTest::newRow("Proxy Authentication Dialog")<< QUrl("http://qt.io/") << QQuickWebEngineAuthenticationDialogRequest::AuthenticationTypeProxy - << QStringLiteral("Proxy requires authentication"); + << QStringLiteral("Proxy requires authentication") + << QByteArrayLiteral("HTTP/1.1 407 Proxy Auth Required\nProxy-Authenticate: " + "Basic realm=\"Proxy requires authentication\"\r\n" + "content-length: 0\r\n\r\n"); + } void tst_Dialogs::authenticationDialogRequested() @@ -159,7 +166,9 @@ void tst_Dialogs::authenticationDialogRequested() QFETCH(QQuickWebEngineAuthenticationDialogRequest::AuthenticationType, type); QFETCH(QString, realm); + QFETCH(QByteArray, reply); Server server; + server.setReply(reply); server.run(); QTRY_VERIFY2(server.isListening(), "Could not setup authentication server"); diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp index 3e5d24381..ed4a030df 100644 --- a/tests/auto/quick/publicapi/tst_publicapi.cpp +++ b/tests/auto/quick/publicapi/tst_publicapi.cpp @@ -332,7 +332,7 @@ static const QStringList expectedAPI = QStringList() << "QQuickWebEngineProfile.downloadRequested(QQuickWebEngineDownloadItem*) --> void" << "QQuickWebEngineProfile.downloadPath --> QString" << "QQuickWebEngineProfile.downloadPathChanged() --> void" - << "QQuickWebEngineProfile.userNotification(QWebEngineNotification*) --> void" + << "QQuickWebEngineProfile.presentNotification(QWebEngineNotification*) --> void" << "QQuickWebEngineProfile.httpAcceptLanguage --> QString" << "QQuickWebEngineProfile.httpAcceptLanguageChanged() --> void" << "QQuickWebEngineProfile.httpCacheMaximumSize --> int" @@ -765,7 +765,6 @@ static const QStringList expectedAPI = QStringList() << "QWebEngineRegisterProtocolHandlerRequest.reject() --> void" << "QWebEngineRegisterProtocolHandlerRequest.scheme --> QString" << "QWebEngineNotification.origin --> QUrl" - << "QWebEngineNotification.icon --> QIcon" << "QWebEngineNotification.title --> QString" << "QWebEngineNotification.message --> QString" << "QWebEngineNotification.tag --> QString" diff --git a/tests/auto/quick/qmltests/data/tst_notification.qml b/tests/auto/quick/qmltests/data/tst_notification.qml index af4aebafc..773bf4a8e 100644 --- a/tests/auto/quick/qmltests/data/tst_notification.qml +++ b/tests/auto/quick/qmltests/data/tst_notification.qml @@ -107,7 +107,7 @@ TestWebEngineView { verify(permissionRequested) let title = 'Title', message = 'Message', notification = null - view.profile.userNotification.connect(function (n) { notification = n }) + view.profile.presentNotification.connect(function (n) { notification = n }) view.runJavaScript('sendNotification("' + title + '", "' + message + '")') tryVerify(function () { return notification !== null }) diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp index eb76be6db..74c04635f 100644 --- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp +++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp @@ -878,7 +878,7 @@ public: setAcceptHoverEvents(true); } - bool event(QEvent *event) Q_DECL_OVERRIDE + bool event(QEvent *event) override { switch (event->type()) { case QEvent::TabletPress: diff --git a/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp b/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp index 2b9742b99..b587f3b27 100644 --- a/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp +++ b/tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp @@ -46,7 +46,7 @@ public: Qt::QueuedConnection); } - virtual void exposeEvent(QExposeEvent *e) Q_DECL_OVERRIDE { + virtual void exposeEvent(QExposeEvent *e) override { QQuickView::exposeEvent(e); emit _q_exposeChanged(); } |