1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "chrome/browser/policy/mock_configuration_policy_store.h" 6 7 namespace policy { 8 9 using ::testing::_; 10 using ::testing::Invoke; 11 12 MockConfigurationPolicyStore::MockConfigurationPolicyStore() { 13 ON_CALL(*this, Apply(_, _)).WillByDefault( 14 Invoke(this, &MockConfigurationPolicyStore::ApplyToMap)); 15 } 16 17 MockConfigurationPolicyStore::~MockConfigurationPolicyStore() {} 18 19 const Value* MockConfigurationPolicyStore::Get( 20 ConfigurationPolicyType type) const { 21 return policy_map_.Get(type); 22 } 23 24 void MockConfigurationPolicyStore::ApplyToMap( 25 ConfigurationPolicyType policy, Value* value) { 26 policy_map_.Set(policy, value); 27 } 28 29 } // namespace policy 30