OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/policy/device_policy_cache.h" | 5 #include "chrome/browser/policy/device_policy_cache.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 7 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
8 #include "chrome/browser/chromeos/login/mock_signed_settings_helper.h" | 8 #include "chrome/browser/chromeos/login/mock_signed_settings_helper.h" |
9 #include "chrome/browser/policy/cloud_policy_data_store.h" | 9 #include "chrome/browser/policy/cloud_policy_data_store.h" |
10 #include "chrome/browser/policy/enterprise_install_attributes.h" | 10 #include "chrome/browser/policy/enterprise_install_attributes.h" |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 GetRecommendedPolicy(kPolicyProxyBypassList))); | 234 GetRecommendedPolicy(kPolicyProxyBypassList))); |
235 } | 235 } |
236 | 236 |
237 TEST_F(DevicePolicyCacheTest, SetDeviceNetworkConfigurationPolicy) { | 237 TEST_F(DevicePolicyCacheTest, SetDeviceNetworkConfigurationPolicy) { |
238 MakeEnterpriseDevice(kTestUser); | 238 MakeEnterpriseDevice(kTestUser); |
239 | 239 |
240 // Startup. | 240 // Startup. |
241 std::string fake_config("{ 'NetworkConfigurations': [] }"); | 241 std::string fake_config("{ 'NetworkConfigurations': [] }"); |
242 em::PolicyFetchResponse policy; | 242 em::PolicyFetchResponse policy; |
243 em::ChromeDeviceSettingsProto settings; | 243 em::ChromeDeviceSettingsProto settings; |
244 settings.mutable_network_configuration()->set_network_configuration( | 244 settings.mutable_open_network_configuration()->set_open_network_configuration( |
245 fake_config); | 245 fake_config); |
246 CreatePolicy(&policy, kTestUser, settings); | 246 CreatePolicy(&policy, kTestUser, settings); |
247 EXPECT_CALL(signed_settings_helper_, StartRetrievePolicyOp(_)).WillOnce( | 247 EXPECT_CALL(signed_settings_helper_, StartRetrievePolicyOp(_)).WillOnce( |
248 MockSignedSettingsHelperRetrievePolicy(SignedSettings::SUCCESS, | 248 MockSignedSettingsHelperRetrievePolicy(SignedSettings::SUCCESS, |
249 policy)); | 249 policy)); |
250 cache_->Load(); | 250 cache_->Load(); |
251 testing::Mock::VerifyAndClearExpectations(&signed_settings_helper_); | 251 testing::Mock::VerifyAndClearExpectations(&signed_settings_helper_); |
252 StringValue expected_config(fake_config); | 252 StringValue expected_config(fake_config); |
253 EXPECT_TRUE( | 253 EXPECT_TRUE( |
254 Value::Equals(&expected_config, | 254 Value::Equals(&expected_config, |
255 GetMandatoryPolicy(kPolicyDeviceNetworkConfiguration))); | 255 GetMandatoryPolicy(kPolicyDeviceOpenNetworkConfiguration))); |
256 } | 256 } |
257 | 257 |
258 } // namespace policy | 258 } // namespace policy |
OLD | NEW |