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 7namespace policy { 8 9using ::testing::_; 10using ::testing::Invoke; 11 12MockConfigurationPolicyStore::MockConfigurationPolicyStore() { 13 ON_CALL(*this, Apply(_, _)).WillByDefault( 14 Invoke(this, &MockConfigurationPolicyStore::ApplyToMap)); 15} 16 17MockConfigurationPolicyStore::~MockConfigurationPolicyStore() {} 18 19const Value* MockConfigurationPolicyStore::Get( 20 ConfigurationPolicyType type) const { 21 return policy_map_.Get(type); 22} 23 24void MockConfigurationPolicyStore::ApplyToMap( 25 ConfigurationPolicyType policy, Value* value) { 26 policy_map_.Set(policy, value); 27} 28 29} // namespace policy 30