summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Bruning <michael.bruning@theqtcompany.com>2015-11-24 17:41:17 +0100
committerJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-12-02 13:29:09 +0000
commite2e61521969932c8b9f1afe13979f21ecf2a5399 (patch)
treec05bb5f88cbb0247b0371318e0e7c04242ff8aee /tests
parent0fe73fcbb9e6a81bd3007e62d7031c56af717571 (diff)
Change QWebEngineUrlRequestInterceptor::interceptRequest to void.
Now uses a flag in QWebEngineUrlRequestInfoPrivate to store if the interceptor actually changed the request. Change-Id: Idccbd1c15696e577ee69248e53b75ba6ec1c571c Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
index 4a261c46b..c4461f1c1 100644
--- a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp
@@ -100,15 +100,14 @@ public:
QList<QUrl> firstPartyUrls;
bool shouldIntercept;
- bool interceptRequest(QWebEngineUrlRequestInfo &info) override
+ void interceptRequest(QWebEngineUrlRequestInfo &info) override
{
info.block(info.requestMethod() != QByteArrayLiteral("GET"));
- if (info.requestUrl().toString().endsWith(QLatin1String("__placeholder__")))
+ if (shouldIntercept && info.requestUrl().toString().endsWith(QLatin1String("__placeholder__")))
info.redirect(QUrl("qrc:///resources/content.html"));
observedUrls.append(info.requestUrl());
firstPartyUrls.append(info.firstPartyUrl());
- return shouldIntercept;
}
TestRequestInterceptor(bool intercept)
: shouldIntercept(intercept)
@@ -162,11 +161,10 @@ class LocalhostContentProvider : public QWebEngineUrlRequestInterceptor
public:
LocalhostContentProvider() { }
- bool interceptRequest(QWebEngineUrlRequestInfo &info) override
+ void interceptRequest(QWebEngineUrlRequestInfo &info) override
{
requestedUrls.append(info.requestUrl());
info.redirect(QUrl("data:text/html,<p>hello"));
- return true;
}
QList<QUrl> requestedUrls;