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

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

Issue 10868076: Only import certificates with Web trust from ONC if the user is managed and matches the enterprise … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaesd Created 8 years, 3 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/policy/network_configuration_updater_unittest.cc
diff --git a/chrome/browser/policy/network_configuration_updater_unittest.cc b/chrome/browser/policy/network_configuration_updater_unittest.cc
index a61a1c2f48099721f6d86737344aab47305e804b..51ae40f92484d582a6a7eb078580054faeb81ab5 100644
--- a/chrome/browser/policy/network_configuration_updater_unittest.cc
+++ b/chrome/browser/policy/network_configuration_updater_unittest.cc
@@ -25,7 +25,7 @@ class NetworkConfigurationUpdaterTest
: public testing::TestWithParam<const char*> {
protected:
virtual void SetUp() OVERRIDE {
- EXPECT_CALL(network_library_, LoadOncNetworks(_, "", _, _))
+ EXPECT_CALL(network_library_, LoadOncNetworks(_, "", _, _, _))
.WillRepeatedly(Return(true));
EXPECT_CALL(provider_, IsInitializationComplete())
.WillRepeatedly(Return(true));
@@ -56,19 +56,37 @@ TEST_P(NetworkConfigurationUpdaterTest, InitialUpdate) {
provider_.UpdateChromePolicy(policy);
EXPECT_CALL(network_library_,
- LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()), _))
+ LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()),
+ false, _))
.WillOnce(Return(true));
NetworkConfigurationUpdater updater(policy_service_.get(), &network_library_);
Mock::VerifyAndClearExpectations(&network_library_);
}
+TEST_P(NetworkConfigurationUpdaterTest, AllowWebTrust) {
+ NetworkConfigurationUpdater updater(policy_service_.get(), &network_library_);
+ updater.set_allow_web_trust(true);
+
+ EXPECT_CALL(network_library_,
+ LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()),
+ true, _))
+ .WillOnce(Return(true));
+
+ PolicyMap policy;
+ policy.Set(GetParam(), POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
+ Value::CreateStringValue(kFakeONC));
+ provider_.UpdateChromePolicy(policy);
+ Mock::VerifyAndClearExpectations(&network_library_);
+}
+
TEST_P(NetworkConfigurationUpdaterTest, PolicyChange) {
NetworkConfigurationUpdater updater(policy_service_.get(), &network_library_);
// We should update if policy changes.
EXPECT_CALL(network_library_,
- LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()), _))
+ LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()),
+ false, _))
.WillOnce(Return(true));
PolicyMap policy;
policy.Set(GetParam(), POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
@@ -78,7 +96,8 @@ TEST_P(NetworkConfigurationUpdaterTest, PolicyChange) {
// No update if the set the same value again.
EXPECT_CALL(network_library_,
- LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()), _))
+ LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()),
+ false, _))
.Times(0);
provider_.UpdateChromePolicy(policy);
Mock::VerifyAndClearExpectations(&network_library_);
@@ -86,7 +105,7 @@ TEST_P(NetworkConfigurationUpdaterTest, PolicyChange) {
// Another update is expected if the policy goes away.
EXPECT_CALL(network_library_,
LoadOncNetworks(NetworkConfigurationUpdater::kEmptyConfiguration,
- "", NameToONCSource(GetParam()), _))
+ "", NameToONCSource(GetParam()), false, _))
.WillOnce(Return(true));
policy.Erase(GetParam());
provider_.UpdateChromePolicy(policy);
« no previous file with comments | « chrome/browser/policy/network_configuration_updater.cc ('k') | chrome/browser/ui/webui/net_internals/net_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698