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

Unified Diff: net/base/cert_verifier_unittest.cc

Issue 5973004: The CertVerifierJob destructor should delete canceled requests.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add a LOG(ERROR) message Created 10 years 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
« net/base/cert_verifier.cc ('K') | « net/base/cert_verifier.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cert_verifier_unittest.cc
===================================================================
--- net/base/cert_verifier_unittest.cc (revision 69550)
+++ net/base/cert_verifier_unittest.cc (working copy)
@@ -257,4 +257,26 @@
}
}
+// Tests that a canceled request is not leaked.
+TEST_F(CertVerifierTest, CancelRequestThenQuit) {
+ scoped_ptr<CertVerifier> verifier(new CertVerifier);
willchan no longer on Chromium 2011/01/04 21:33:54 Nit: Does this need to be heap allocated?
+
+ FilePath certs_dir = GetTestCertsDirectory();
+ scoped_refptr<X509Certificate> google_cert(
+ ImportCertFromFile(certs_dir, "google.single.der"));
+ ASSERT_NE(static_cast<X509Certificate*>(NULL), google_cert);
+
+ int error;
+ CertVerifyResult verify_result;
+ TestCompletionCallback callback;
+ CertVerifier::RequestHandle request_handle;
+
+ error = verifier->Verify(google_cert, "www.example.com", 0, &verify_result,
+ &callback, &request_handle);
+ ASSERT_EQ(ERR_IO_PENDING, error);
+ ASSERT_TRUE(request_handle != NULL);
+ verifier->CancelRequest(request_handle);
+ verifier.reset();
+}
+
} // namespace net
« net/base/cert_verifier.cc ('K') | « net/base/cert_verifier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698