diff options
Diffstat (limited to 'tests/auto/widgets/certificateerror/tst_certificateerror.cpp')
-rw-r--r-- | tests/auto/widgets/certificateerror/tst_certificateerror.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/widgets/certificateerror/tst_certificateerror.cpp b/tests/auto/widgets/certificateerror/tst_certificateerror.cpp index f11d9236c..c5b761818 100644 --- a/tests/auto/widgets/certificateerror/tst_certificateerror.cpp +++ b/tests/auto/widgets/certificateerror/tst_certificateerror.cpp @@ -43,6 +43,7 @@ public: private Q_SLOTS: void handleError_data(); void handleError(); + void fatalError(); }; struct PageWithCertificateErrorHandler : QWebEnginePage @@ -120,5 +121,21 @@ void tst_CertificateError::handleError() QCOMPARE(toPlainTextSync(&page), expectedContent); } +void tst_CertificateError::fatalError() +{ + PageWithCertificateErrorHandler page(false, false); + page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false); + QSignalSpy loadFinishedSpy(&page, &QWebEnginePage::loadFinished); + + page.setUrl(QUrl("https://revoked.badssl.com")); + if (!loadFinishedSpy.wait(10000)) + QSKIP("Couldn't load page from network, skipping test."); + QTRY_VERIFY(page.error); + QVERIFY(!page.error->isOverridable()); + + // Fatal certificate errors are implicitly rejected. This should not cause crash. + page.error->rejectCertificate(); +} + QTEST_MAIN(tst_CertificateError) #include <tst_certificateerror.moc> |