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

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: Win shared fix Created 8 years, 9 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
« no previous file with comments | « net/base/transport_security_state_unittest.cc ('k') | net/http/http_network_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/disk_cache_based_ssl_host_info_unittest.cc
===================================================================
--- net/http/disk_cache_based_ssl_host_info_unittest.cc (revision 128056)
+++ net/http/disk_cache_based_ssl_host_info_unittest.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -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 @@
// 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::CreateDefault());
// 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 @@
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 @@
net::TestCompletionCallback callback;
// Store a certificate chain.
- net::CertVerifier cert_verifier;
+ scoped_ptr<net::CertVerifier> cert_verifier(
+ net::CertVerifier::CreateDefault());
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 @@
// 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 @@
// 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));
« no previous file with comments | « net/base/transport_security_state_unittest.cc ('k') | net/http/http_network_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698