| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 &install_attributes_, | 84 &install_attributes_, |
| 85 &signed_settings_helper_)); | 85 &signed_settings_helper_)); |
| 86 } | 86 } |
| 87 | 87 |
| 88 virtual void TearDown() { | 88 virtual void TearDown() { |
| 89 cache_.reset(); | 89 cache_.reset(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void MakeEnterpriseDevice(const char* registration_user) { | 92 void MakeEnterpriseDevice(const char* registration_user) { |
| 93 ASSERT_EQ(EnterpriseInstallAttributes::LOCK_SUCCESS, | 93 ASSERT_EQ(EnterpriseInstallAttributes::LOCK_SUCCESS, |
| 94 install_attributes_.LockDevice(registration_user)); | 94 install_attributes_.LockDevice( |
| 95 registration_user, |
| 96 DEVICE_MODE_ENTERPRISE, |
| 97 std::string())); |
| 95 } | 98 } |
| 96 | 99 |
| 97 const Value* GetPolicy(const char* policy_name) { | 100 const Value* GetPolicy(const char* policy_name) { |
| 98 return cache_->policy()->GetValue(policy_name); | 101 return cache_->policy()->GetValue(policy_name); |
| 99 } | 102 } |
| 100 | 103 |
| 101 scoped_ptr<chromeos::CryptohomeLibrary> cryptohome_; | 104 scoped_ptr<chromeos::CryptohomeLibrary> cryptohome_; |
| 102 EnterpriseInstallAttributes install_attributes_; | 105 EnterpriseInstallAttributes install_attributes_; |
| 103 scoped_ptr<CloudPolicyDataStore> data_store_; | 106 scoped_ptr<CloudPolicyDataStore> data_store_; |
| 104 chromeos::MockSignedSettingsHelper signed_settings_helper_; | 107 chromeos::MockSignedSettingsHelper signed_settings_helper_; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 policy)); | 246 policy)); |
| 244 cache_->Load(); | 247 cache_->Load(); |
| 245 testing::Mock::VerifyAndClearExpectations(&signed_settings_helper_); | 248 testing::Mock::VerifyAndClearExpectations(&signed_settings_helper_); |
| 246 StringValue expected_config(fake_config); | 249 StringValue expected_config(fake_config); |
| 247 EXPECT_TRUE( | 250 EXPECT_TRUE( |
| 248 Value::Equals(&expected_config, | 251 Value::Equals(&expected_config, |
| 249 GetPolicy(key::kDeviceOpenNetworkConfiguration))); | 252 GetPolicy(key::kDeviceOpenNetworkConfiguration))); |
| 250 } | 253 } |
| 251 | 254 |
| 252 } // namespace policy | 255 } // namespace policy |
| OLD | NEW |