summaryrefslogtreecommitdiffstats
path: root/chrome/browser/mock_configuration_policy_store.h
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-14 13:17:40 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-14 13:17:40 +0000
commitc378cca3b4c7f2c48184283f3ab2ac5818233037 (patch)
treeae94b40eb8fb1432307a80818f6ee04437e149cf /chrome/browser/mock_configuration_policy_store.h
parent70c19a930beddde0e382777cb8799e7c8ebb1625 (diff)
downloadchromium_src-c378cca3b4c7f2c48184283f3ab2ac5818233037.zip
chromium_src-c378cca3b4c7f2c48184283f3ab2ac5818233037.tar.gz
chromium_src-c378cca3b4c7f2c48184283f3ab2ac5818233037.tar.bz2
Preference provider implementation backed by JSON files in a directory.
BUG=42412 TEST=Unit tests in chrome/browser/value_tree_policy_decoder.cc and base/values_unittest.cc Review URL: http://codereview.chromium.org/2027010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/mock_configuration_policy_store.h')
-rw-r--r--chrome/browser/mock_configuration_policy_store.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/chrome/browser/mock_configuration_policy_store.h b/chrome/browser/mock_configuration_policy_store.h
new file mode 100644
index 0000000..b1f3696
--- /dev/null
+++ b/chrome/browser/mock_configuration_policy_store.h
@@ -0,0 +1,34 @@
+// 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.
+
+#ifndef CHROME_BROWSER_MOCK_CONFIGURATION_POLICY_STORE_H_
+#define CHROME_BROWSER_MOCK_CONFIGURATION_POLICY_STORE_H_
+
+#include <map>
+
+#include "base/stl_util-inl.h"
+#include "chrome/browser/configuration_policy_store.h"
+
+// Mock ConfigurationPolicyStore implementation that records values for policy
+// settings as they get set.
+class MockConfigurationPolicyStore : public ConfigurationPolicyStore {
+ public:
+ MockConfigurationPolicyStore() {}
+ ~MockConfigurationPolicyStore() {
+ STLDeleteValues(&policy_map_);
+ }
+
+ typedef std::map<ConfigurationPolicyStore::PolicyType, Value*> PolicyMap;
+ const PolicyMap& policy_map() { return policy_map_; }
+
+ // ConfigurationPolicyStore implementation.
+ virtual void Apply(PolicyType policy, Value* value) {
+ policy_map_[policy] = value;
+ }
+
+ private:
+ PolicyMap policy_map_;
+};
+
+#endif // CHROME_BROWSER_MOCK_CONFIGURATION_POLICY_STORE_H_