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

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

Issue 24153012: Fix cyclic dependency between ProfilePolicyConnector and PrefService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed another bug for OTRProfile. 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/network_configuration_updater_unittest.cc
diff --git a/chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc b/chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc
index 8f72c50a0abdc5ba4214071afc5390dd6185b276..2847068f30cbeb93ac59f8ef2ea7421e53dd4259 100644
--- a/chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc
+++ b/chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc
@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
@@ -264,14 +265,15 @@ TEST_F(NetworkConfigurationUpdaterTest,
// Certificates with the "Web" trust flag set should not be forwarded to the
// trust provider.
- policy::PolicyCertVerifier cert_verifier((
- base::Closure() /* no policy cert trusted callback */));
- updater->SetPolicyCertVerifier(&cert_verifier);
+ policy::PolicyCertVerifier cert_verifier(base::Bind(&base::DoNothing));
+ updater->AddPolicyCertVerifier(&cert_verifier);
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(cert_verifier.GetAdditionalTrustAnchors().empty());
- // |cert_verifier| must outlive the updater.
+ updater->RemovePolicyCertVerifier(&cert_verifier);
network_configuration_updater_.reset();
+
+ cert_verifier.UnsetTrustAnchorUsedCallback();
}
TEST_F(NetworkConfigurationUpdaterTest, AllowTrustedCertificatesFromPolicy) {
@@ -294,14 +296,15 @@ TEST_F(NetworkConfigurationUpdaterTest, AllowTrustedCertificatesFromPolicy) {
// Certificates with the "Web" trust flag set should be forwarded to the
// trust provider.
- policy::PolicyCertVerifier cert_verifier((
- base::Closure() /* no policy cert trusted callback */));
- updater->SetPolicyCertVerifier(&cert_verifier);
+ policy::PolicyCertVerifier cert_verifier(base::Bind(&base::DoNothing));
+ updater->AddPolicyCertVerifier(&cert_verifier);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(1u, cert_verifier.GetAdditionalTrustAnchors().size());
- // |cert_verifier| must outlive the updater.
+ updater->RemovePolicyCertVerifier(&cert_verifier);
network_configuration_updater_.reset();
+
+ cert_verifier.UnsetTrustAnchorUsedCallback();
}
class NetworkConfigurationUpdaterTestWithParam

Powered by Google App Engine
This is Rietveld 408576698