Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: chrome/browser/policy/configuration_policy_pref_store_test.cc

Issue 109743002: Move policy code into components/policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar fixes Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/configuration_policy_pref_store_test.cc
diff --git a/chrome/browser/policy/configuration_policy_pref_store_test.cc b/chrome/browser/policy/configuration_policy_pref_store_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5a0ca23468f5e71609e475040ba958f63dd9abf5
--- /dev/null
+++ b/chrome/browser/policy/configuration_policy_pref_store_test.cc
@@ -0,0 +1,46 @@
+// Copyright 2013 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/configuration_policy_pref_store_test.h"
+
+#include <string>
+
+#include "base/run_loop.h"
+#include "components/policy/core/browser/configuration_policy_pref_store.h"
+#include "components/policy/core/common/policy_details.h"
+#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_service_impl.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+using testing::Return;
+using testing::_;
+
+namespace policy {
+
+ConfigurationPolicyPrefStoreTest::ConfigurationPolicyPrefStoreTest()
+ : handler_list_(GetChromePolicyDetailsCallback()) {
+ EXPECT_CALL(provider_, IsInitializationComplete(_))
+ .WillRepeatedly(Return(false));
+ provider_.Init();
+ providers_.push_back(&provider_);
+ policy_service_.reset(new PolicyServiceImpl(
+ providers_, PolicyServiceImpl::PreprocessCallback()));
+ store_ = new ConfigurationPolicyPrefStore(
+ policy_service_.get(), &handler_list_, POLICY_LEVEL_MANDATORY);
+}
+
+ConfigurationPolicyPrefStoreTest::~ConfigurationPolicyPrefStoreTest() {}
+
+void ConfigurationPolicyPrefStoreTest::TearDown() {
+ provider_.Shutdown();
+}
+
+void ConfigurationPolicyPrefStoreTest::UpdateProviderPolicy(
+ const PolicyMap& policy) {
+ provider_.UpdateChromePolicy(policy);
+ base::RunLoop loop;
+ loop.RunUntilIdle();
+}
+
+} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698