| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/policy/profile_policy_connector.h" | 5 #include "chrome/browser/policy/user_policy_connector.h" |
| 6 #include "chrome/browser/policy/mock_configuration_policy_provider.h" | 6 #include "chrome/browser/policy/mock_configuration_policy_provider.h" |
| 7 #include "chrome/browser/policy/mock_configuration_policy_store.h" | 7 #include "chrome/browser/policy/mock_configuration_policy_store.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 using ::testing::_; | 10 using ::testing::_; |
| 11 | 11 |
| 12 namespace policy { | 12 namespace policy { |
| 13 | 13 // TODO: throw away |
| 14 /* |
| 14 TEST(MergingPolicyProviderTest, MergeProxySettings) { | 15 TEST(MergingPolicyProviderTest, MergeProxySettings) { |
| 15 MockConfigurationPolicyProvider browser_provider; | 16 MockConfigurationPolicyProvider browser_provider; |
| 16 MockConfigurationPolicyProvider profile_provider; | 17 MockConfigurationPolicyProvider profile_provider; |
| 17 MergingPolicyProvider merging_provider(&browser_provider, &profile_provider); | 18 MergingPolicyProvider merging_provider(&browser_provider, &profile_provider); |
| 18 | 19 |
| 19 // First, test settings from profile and no proxy settings from browser. | 20 // First, test settings from profile and no proxy settings from browser. |
| 20 // Only the profile policies should be forwarded. | 21 // Only the profile policies should be forwarded. |
| 21 browser_provider.AddPolicy(kPolicyJavascriptEnabled, | 22 browser_provider.AddPolicy(kPolicyJavascriptEnabled, |
| 22 Value::CreateBooleanValue(true)); | 23 Value::CreateBooleanValue(true)); |
| 23 profile_provider.AddPolicy(kPolicyPrintingEnabled, | 24 profile_provider.AddPolicy(kPolicyPrintingEnabled, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 46 Value::CreateStringValue("http://proxy:8080")); | 47 Value::CreateStringValue("http://proxy:8080")); |
| 47 | 48 |
| 48 MockConfigurationPolicyStore store2; | 49 MockConfigurationPolicyStore store2; |
| 49 EXPECT_CALL(store2, Apply(_, _)).Times(2); | 50 EXPECT_CALL(store2, Apply(_, _)).Times(2); |
| 50 EXPECT_TRUE(merging_provider.Provide(&store2)); | 51 EXPECT_TRUE(merging_provider.Provide(&store2)); |
| 51 EXPECT_EQ(store2.policy_map().size(), 2u); | 52 EXPECT_EQ(store2.policy_map().size(), 2u); |
| 52 EXPECT_TRUE(store2.Get(kPolicyPrintingEnabled) != NULL); | 53 EXPECT_TRUE(store2.Get(kPolicyPrintingEnabled) != NULL); |
| 53 EXPECT_TRUE(store2.Get(kPolicyProxyServer) != NULL); | 54 EXPECT_TRUE(store2.Get(kPolicyProxyServer) != NULL); |
| 54 EXPECT_TRUE(store2.Get(kPolicyProxyMode) == NULL); | 55 EXPECT_TRUE(store2.Get(kPolicyProxyMode) == NULL); |
| 55 } | 56 } |
| 56 | 57 */ |
| 57 } // namespace policy | 58 } // namespace policy |
| OLD | NEW |