diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-27 13:49:30 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-01 22:32:13 +0000 |
commit | 4dc312011bcaa2ee2cf812b5b84dc9238130e608 (patch) | |
tree | 495513b9fe73d2d1e45ea84c3e00e43e4625a5ee /tests | |
parent | 9e299978cfb40e01f2871b71129a02f4b5b7404d (diff) |
Tie client certificate stores to profiles
Move the client certificate store from being global to being tied
to individual profiles.
Change-Id: Ib21ae14c501b7d0612b84ae7535120291aeeada2
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/core/qwebengineclientcertificatestore/tst_qwebengineclientcertificatestore.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
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 <QtTest/QtTest> #include <QtWebEngineCore/qwebengineclientcertificatestore.h> +#include <QtWebEngineWidgets/qwebengineprofile.h> 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) |