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

Unified Diff: chrome/browser/chromeos/policy/policy_cert_verifier_browsertest.cc

Issue 24153012: Fix cyclic dependency between ProfilePolicyConnector and PrefService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use callback_list in PolicyCertVerifier. Created 7 years, 2 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: chrome/browser/chromeos/policy/policy_cert_verifier_browsertest.cc
diff --git a/chrome/browser/chromeos/policy/policy_cert_verifier_browsertest.cc b/chrome/browser/chromeos/policy/policy_cert_verifier_browsertest.cc
index 002cb87d9351ce44679ddd1d88c177ad51c1aff6..f8af6d7f55f12825be79db12afd2a844794f2ff2 100644
--- a/chrome/browser/chromeos/policy/policy_cert_verifier_browsertest.cc
+++ b/chrome/browser/chromeos/policy/policy_cert_verifier_browsertest.cc
@@ -42,8 +42,10 @@ class PolicyCertVerifierTest : public testing::Test {
ASSERT_TRUE(test_nssdb_.is_open());
cert_db_ = net::NSSCertDatabase::GetInstance();
- cert_verifier_.reset(new PolicyCertVerifier(base::Bind(
- &PolicyCertVerifierTest::OnTrustAnchorUsed, base::Unretained(this))));
+ cert_verifier_.reset(new PolicyCertVerifier());
+ cert_verifier_subscription_ = cert_verifier_->RegisterAnchorUsedCallback(
+ base::Bind(&PolicyCertVerifierTest::OnTrustAnchorUsed,
+ base::Unretained(this)));
cert_verifier_->InitializeOnIOThread();
test_ca_cert_ = LoadCertificate("root_ca_cert.pem", net::CA_CERT);
@@ -54,8 +56,10 @@ class PolicyCertVerifierTest : public testing::Test {
}
virtual void TearDown() OVERRIDE {
- // Destroy |cert_verifier_| before destroying the ThreadBundle, otherwise
+ cert_verifier_subscription_.reset();
+ // Destroy |cert_verifier_| before destroying the ThreadBundle, otherwise
Joao da Silva 2013/10/16 12:44:58 indent
pneubeck (no reviews) 2013/10/22 18:47:41 Done.
// BrowserThread::CurrentlyOn checks fail.
+ cert_verifier_->ShutdownOnUIThread();
cert_verifier_.reset();
}
@@ -89,6 +93,11 @@ class PolicyCertVerifierTest : public testing::Test {
return result;
}
+ private:
+ scoped_ptr<base::CallbackList<void()>::Subscription>
+ cert_verifier_subscription_;
Joao da Silva 2013/10/16 12:44:58 Can't this come below after |thread_bundle_|, sinc
pneubeck (no reviews) 2013/10/22 18:47:41 Yes. I think the reason why I moved it here vanish
+
+ public:
// |test_ca_cert_| is the issuer of |test_server_cert_|.
scoped_refptr<net::X509Certificate> test_ca_cert_;
scoped_refptr<net::X509Certificate> test_server_cert_;

Powered by Google App Engine
This is Rietveld 408576698