summaryrefslogtreecommitdiffstats
path: root/tests/auto/core/certificateerror/tst_certificateerror.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/core/certificateerror/tst_certificateerror.cpp')
-rw-r--r--tests/auto/core/certificateerror/tst_certificateerror.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/auto/core/certificateerror/tst_certificateerror.cpp b/tests/auto/core/certificateerror/tst_certificateerror.cpp
index 67e2d8ae4..252e1544d 100644
--- a/tests/auto/core/certificateerror/tst_certificateerror.cpp
+++ b/tests/auto/core/certificateerror/tst_certificateerror.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2019 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <httpsserver.h>
#include <util.h>
@@ -19,6 +19,7 @@ private Q_SLOTS:
void handleError_data();
void handleError();
void fatalError();
+ void resourceError();
};
struct PageWithCertificateErrorHandler : QWebEnginePage
@@ -130,5 +131,20 @@ void tst_CertificateError::fatalError()
}
}
+void tst_CertificateError::resourceError()
+{
+ PageWithCertificateErrorHandler page(false, false);
+ page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
+
+ page.setHtml("<img src=\"https://expired.badssl.com\">");
+ if (!page.loadSpy.wait(10000)) {
+ QVERIFY2(!page.error, "There shouldn't be any certificate error if not loaded due to missing internet access!");
+ QSKIP("Couldn't load page from network, skipping test.");
+ }
+
+ QTRY_VERIFY(page.error);
+ QCOMPARE(page.error->isMainFrame(), false);
+}
+
QTEST_MAIN(tst_CertificateError)
#include <tst_certificateerror.moc>