Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: net/http/disk_cache_based_ssl_host_info_unittest.cc

Issue 9476035: Make CertVerifier a pure virtual interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Two header fixes Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/http/disk_cache_based_ssl_host_info_unittest.cc
diff --git a/net/http/disk_cache_based_ssl_host_info_unittest.cc b/net/http/disk_cache_based_ssl_host_info_unittest.cc
index 9fb4727b1d3d60625dc3cd50962e6ce759451d10..6e609d51163a9bb076882a6254a21935cc329b1b 100644
--- a/net/http/disk_cache_based_ssl_host_info_unittest.cc
+++ b/net/http/disk_cache_based_ssl_host_info_unittest.cc
@@ -6,6 +6,7 @@
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
#include "base/message_loop.h"
+#include "net/base/cert_verifier.h"
#include "net/base/net_errors.h"
#include "net/base/ssl_config_service.h"
#include "net/http/disk_cache_based_ssl_host_info.h"
@@ -33,7 +34,8 @@ const MockTransaction kHostInfoTransaction = {
// Tests that we can delete a DiskCacheBasedSSLHostInfo object in a
// completion callback for DiskCacheBasedSSLHostInfo::WaitForDataReady.
TEST(DiskCacheBasedSSLHostInfo, DeleteInCallback) {
- net::CertVerifier cert_verifier;
+ scoped_ptr<net::CertVerifier> cert_verifier(
+ net::CertVerifier::CreateDefaultCertVerifier());
// Use the blocking mock backend factory to force asynchronous completion
// of ssl_host_info->WaitForDataReady(), so that the callback will run.
MockBlockingBackendFactory* factory = new MockBlockingBackendFactory();
@@ -41,7 +43,8 @@ TEST(DiskCacheBasedSSLHostInfo, DeleteInCallback) {
net::SSLConfig ssl_config;
scoped_ptr<net::SSLHostInfo> ssl_host_info(
new net::DiskCacheBasedSSLHostInfo("https://www.verisign.com", ssl_config,
- &cert_verifier, cache.http_cache()));
+ cert_verifier.get(),
+ cache.http_cache()));
ssl_host_info->Start();
net::TestCompletionCallback callback;
int rv = ssl_host_info->WaitForDataReady(callback.callback());
@@ -58,11 +61,13 @@ TEST(DiskCacheBasedSSLHostInfo, Update) {
net::TestCompletionCallback callback;
// Store a certificate chain.
- net::CertVerifier cert_verifier;
+ scoped_ptr<net::CertVerifier> cert_verifier(
+ net::CertVerifier::CreateDefaultCertVerifier());
net::SSLConfig ssl_config;
scoped_ptr<net::SSLHostInfo> ssl_host_info(
new net::DiskCacheBasedSSLHostInfo("https://www.google.com", ssl_config,
- &cert_verifier, cache.http_cache()));
+ cert_verifier.get(),
+ cache.http_cache()));
ssl_host_info->Start();
int rv = ssl_host_info->WaitForDataReady(callback.callback());
EXPECT_EQ(net::OK, callback.GetResult(rv));
@@ -78,7 +83,8 @@ TEST(DiskCacheBasedSSLHostInfo, Update) {
// Open the stored certificate chain.
ssl_host_info.reset(
new net::DiskCacheBasedSSLHostInfo("https://www.google.com", ssl_config,
- &cert_verifier, cache.http_cache()));
+ cert_verifier.get(),
+ cache.http_cache()));
ssl_host_info->Start();
rv = ssl_host_info->WaitForDataReady(callback.callback());
EXPECT_EQ(net::OK, callback.GetResult(rv));
@@ -97,7 +103,8 @@ TEST(DiskCacheBasedSSLHostInfo, Update) {
// Verify that the state was updated.
ssl_host_info.reset(
new net::DiskCacheBasedSSLHostInfo("https://www.google.com", ssl_config,
- &cert_verifier, cache.http_cache()));
+ cert_verifier.get(),
+ cache.http_cache()));
ssl_host_info->Start();
rv = ssl_host_info->WaitForDataReady(callback.callback());
EXPECT_EQ(net::OK, callback.GetResult(rv));

Powered by Google App Engine
This is Rietveld 408576698