From 4dc312011bcaa2ee2cf812b5b84dc9238130e608 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 27 Feb 2019 13:49:30 +0100 Subject: Tie client certificate stores to profiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the client certificate store from being global to being tied to individual profiles. Change-Id: Ib21ae14c501b7d0612b84ae7535120291aeeada2 Reviewed-by: Jüri Valdmann --- .../tst_qwebengineclientcertificatestore.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.cpp') diff --git a/tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.cpp b/tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.cpp index fe2f71418..03e68c533 100644 --- a/tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.cpp +++ b/tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.cpp @@ -28,6 +28,7 @@ #include #include +#include class tst_QWebEngineClientCertificateStore : public QObject { @@ -73,24 +74,24 @@ void tst_QWebEngineClientCertificateStore::addAndListCertificates() const QSslKey sslKeySecond(keyFileSecond.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey, ""); // Add certificates to in-memory store - QWebEngineClientCertificateStore::getInstance()->add(cert, sslKey); - QWebEngineClientCertificateStore::getInstance()->add(certSecond, sslKeySecond); + QWebEngineProfile::defaultProfile()->clientCertificateStore()->add(cert, sslKey); + QWebEngineProfile::defaultProfile()->clientCertificateStore()->add(certSecond, sslKeySecond); - QCOMPARE(2, QWebEngineClientCertificateStore::getInstance()->toList().length()); + QCOMPARE(2, QWebEngineProfile::defaultProfile()->clientCertificateStore()->toList().length()); } void tst_QWebEngineClientCertificateStore::removeAndClearCertificates() { - QCOMPARE(2, QWebEngineClientCertificateStore::getInstance()->toList().length()); + QCOMPARE(2, QWebEngineProfile::defaultProfile()->clientCertificateStore()->toList().length()); // Remove one certificate from in-memory store - auto list = QWebEngineClientCertificateStore::getInstance()->toList(); - QWebEngineClientCertificateStore::getInstance()->remove(list[0].certificate); - QCOMPARE(1, QWebEngineClientCertificateStore::getInstance()->toList().length()); + auto list = QWebEngineProfile::defaultProfile()->clientCertificateStore()->toList(); + QWebEngineProfile::defaultProfile()->clientCertificateStore()->remove(list[0].certificate); + QCOMPARE(1, QWebEngineProfile::defaultProfile()->clientCertificateStore()->toList().length()); // Remove all certificates in-memory store - QWebEngineClientCertificateStore::getInstance()->clear(); - QCOMPARE(0, QWebEngineClientCertificateStore::getInstance()->toList().length()); + QWebEngineProfile::defaultProfile()->clientCertificateStore()->clear(); + QCOMPARE(0, QWebEngineProfile::defaultProfile()->clientCertificateStore()->toList().length()); } QTEST_MAIN(tst_QWebEngineClientCertificateStore) -- cgit v1.2.3