diff options
author | Michal Klocek <michal.klocek@qt.io> | 2020-08-06 12:26:44 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2020-08-14 16:34:27 +0200 |
commit | 5dde7a21706b399a6c14b3ab0a12e70f5d26dafa (patch) | |
tree | 8f823bd6f42989d8345606080c7bf42a6ab74d8a /tests/auto/widgets | |
parent | 1ab9b08e62a04770d275b5eebacdcb6a7bd0816a (diff) |
Unify certificate error handling
Before we move the certificate error to core, unify
error handling between qml and widgets.
[ChangeLog] WebPage::certificateError does not return bool
it is enough to call defer, ignoreCertificateError()
or rejectCertificate().
Change-Id: I14be40f1ab6b4cbded550260d66152f51cf47de2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r-- | tests/auto/widgets/certificateerror/tst_certificateerror.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/auto/widgets/certificateerror/tst_certificateerror.cpp b/tests/auto/widgets/certificateerror/tst_certificateerror.cpp index f11d9236c..34508be0c 100644 --- a/tests/auto/widgets/certificateerror/tst_certificateerror.cpp +++ b/tests/auto/widgets/certificateerror/tst_certificateerror.cpp @@ -57,11 +57,18 @@ struct PageWithCertificateErrorHandler : QWebEnginePage QSignalSpy loadSpy; QScopedPointer<QWebEngineCertificateError> error; - bool certificateError(const QWebEngineCertificateError &e) override { + void certificateError(const QWebEngineCertificateError &e) override + { error.reset(new QWebEngineCertificateError(e)); - if (deferError) + if (deferError) { error->defer(); - return acceptCertificate; + return; + } + + if (acceptCertificate) + error->ignoreCertificateError(); + else + error->rejectCertificate(); } }; |