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

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

Issue 6979011: Move user cloud policy to BrowserProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments by mnissler. Created 9 years, 6 months 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/profile_policy_connector_unittest.cc
diff --git a/chrome/browser/policy/profile_policy_connector_unittest.cc b/chrome/browser/policy/profile_policy_connector_unittest.cc
deleted file mode 100644
index 7cef1e7fe69d08037502aeb242434c2eb7996119..0000000000000000000000000000000000000000
--- a/chrome/browser/policy/profile_policy_connector_unittest.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2011 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/profile_policy_connector.h"
-#include "chrome/browser/policy/mock_configuration_policy_provider.h"
-#include "chrome/browser/policy/mock_configuration_policy_store.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using ::testing::_;
-
-namespace policy {
-
-TEST(MergingPolicyProviderTest, MergeProxySettings) {
- MockConfigurationPolicyProvider browser_provider;
- MockConfigurationPolicyProvider profile_provider;
- MergingPolicyProvider merging_provider(&browser_provider, &profile_provider);
-
- // First, test settings from profile and no proxy settings from browser.
- // Only the profile policies should be forwarded.
- browser_provider.AddPolicy(kPolicyJavascriptEnabled,
- Value::CreateBooleanValue(true));
- profile_provider.AddPolicy(kPolicyPrintingEnabled,
- Value::CreateBooleanValue(true));
-
- MockConfigurationPolicyStore store0;
- EXPECT_CALL(store0, Apply(_, _)).Times(1);
- EXPECT_TRUE(merging_provider.Provide(&store0));
- EXPECT_EQ(store0.policy_map().size(), 1u);
- EXPECT_TRUE(store0.Get(kPolicyPrintingEnabled) != NULL);
-
- // Now have a proxy policy that should be merged.
- browser_provider.AddPolicy(kPolicyProxyMode,
- Value::CreateStringValue("direct"));
-
- MockConfigurationPolicyStore store1;
- EXPECT_CALL(store1, Apply(_, _)).Times(2);
- EXPECT_TRUE(merging_provider.Provide(&store1));
- EXPECT_EQ(store1.policy_map().size(), 2u);
- EXPECT_TRUE(store1.Get(kPolicyPrintingEnabled) != NULL);
- EXPECT_TRUE(store1.Get(kPolicyProxyMode) != NULL);
-
- // If the profile includes any proxy policy, no proxy policies should be
- // merged from the browser provider.
- profile_provider.AddPolicy(kPolicyProxyServer,
- Value::CreateStringValue("http://proxy:8080"));
-
- MockConfigurationPolicyStore store2;
- EXPECT_CALL(store2, Apply(_, _)).Times(2);
- EXPECT_TRUE(merging_provider.Provide(&store2));
- EXPECT_EQ(store2.policy_map().size(), 2u);
- EXPECT_TRUE(store2.Get(kPolicyPrintingEnabled) != NULL);
- EXPECT_TRUE(store2.Get(kPolicyProxyServer) != NULL);
- EXPECT_TRUE(store2.Get(kPolicyProxyMode) == NULL);
-}
-
-} // namespace policy
« no previous file with comments | « chrome/browser/policy/profile_policy_connector_factory.cc ('k') | chrome/browser/policy/user_policy_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698