summaryrefslogtreecommitdiffstats
path: root/chrome/browser/policy/mock_configuration_policy_store.cc
blob: 1cbf4386d5c6eb4427be8333520eabdd6db6d84b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/policy/mock_configuration_policy_store.h"

namespace policy {

using ::testing::_;
using ::testing::Invoke;

MockConfigurationPolicyStore::MockConfigurationPolicyStore() {
  ON_CALL(*this, Apply(_, _)).WillByDefault(
      Invoke(this, &MockConfigurationPolicyStore::ApplyToMap));
}

MockConfigurationPolicyStore::~MockConfigurationPolicyStore() {}

const Value* MockConfigurationPolicyStore::Get(
    ConfigurationPolicyType type) const {
  return policy_map_.Get(type);
}

void MockConfigurationPolicyStore::ApplyToMap(
    ConfigurationPolicyType policy, Value* value) {
  policy_map_.Set(policy, value);
}

}  // namespace policy