Index: chrome/browser/chromeos/policy/configuration_policy_handler_chromeos_unittest.cc |
diff --git a/chrome/browser/chromeos/policy/configuration_policy_handler_chromeos_unittest.cc b/chrome/browser/chromeos/policy/configuration_policy_handler_chromeos_unittest.cc |
index b654188ead171425120fd340481997569bfbd995..a5691b8bbadad0d519d5d91316f5049e088b856c 100644 |
--- a/chrome/browser/chromeos/policy/configuration_policy_handler_chromeos_unittest.cc |
+++ b/chrome/browser/chromeos/policy/configuration_policy_handler_chromeos_unittest.cc |
@@ -14,6 +14,7 @@ |
#include "components/policy/core/browser/policy_error_map.h" |
#include "components/policy/core/common/external_data_fetcher.h" |
#include "components/policy/core/common/policy_map.h" |
+#include "components/policy/core/common/policy_types.h" |
#include "components/policy/core/common/schema.h" |
#include "policy/policy_constants.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -61,6 +62,7 @@ TEST_F(ScreenMagnifierPolicyHandlerTest, Disabled) { |
policy_.Set(key::kScreenMagnifierType, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::FundamentalValue(0), |
NULL); |
handler_.ApplyPolicySettings(policy_, &prefs_); |
@@ -81,6 +83,7 @@ TEST_F(ScreenMagnifierPolicyHandlerTest, Enabled) { |
policy_.Set(key::kScreenMagnifierType, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::FundamentalValue(1), |
NULL); |
handler_.ApplyPolicySettings(policy_, &prefs_); |
@@ -109,6 +112,7 @@ TEST(ExternalDataPolicyHandlerTest, WrongType) { |
policy_map.Set(key::kUserAvatarImage, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::FundamentalValue(false), |
NULL); |
PolicyErrorMap errors; |
@@ -124,6 +128,7 @@ TEST(ExternalDataPolicyHandlerTest, MissingURL) { |
policy_map.Set(key::kUserAvatarImage, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
dict.release(), |
NULL); |
PolicyErrorMap errors; |
@@ -140,6 +145,7 @@ TEST(ExternalDataPolicyHandlerTest, InvalidURL) { |
policy_map.Set(key::kUserAvatarImage, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
dict.release(), |
NULL); |
PolicyErrorMap errors; |
@@ -155,6 +161,7 @@ TEST(ExternalDataPolicyHandlerTest, MissingHash) { |
policy_map.Set(key::kUserAvatarImage, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
dict.release(), |
NULL); |
PolicyErrorMap errors; |
@@ -171,6 +178,7 @@ TEST(ExternalDataPolicyHandlerTest, InvalidHash) { |
policy_map.Set(key::kUserAvatarImage, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
dict.release(), |
NULL); |
PolicyErrorMap errors; |
@@ -189,6 +197,7 @@ TEST(ExternalDataPolicyHandlerTest, Valid) { |
policy_map.Set(key::kUserAvatarImage, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
dict.release(), |
NULL); |
PolicyErrorMap errors; |
@@ -249,6 +258,7 @@ TEST(NetworkConfigurationPolicyHandlerTest, ValidONC) { |
policy_map.Set(key::kOpenNetworkConfiguration, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kTestONC), |
NULL); |
scoped_ptr<NetworkConfigurationPolicyHandler> handler( |
@@ -263,6 +273,7 @@ TEST(NetworkConfigurationPolicyHandlerTest, WrongType) { |
policy_map.Set(key::kOpenNetworkConfiguration, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::FundamentalValue(false), |
NULL); |
scoped_ptr<NetworkConfigurationPolicyHandler> handler( |
@@ -278,6 +289,7 @@ TEST(NetworkConfigurationPolicyHandlerTest, JSONParseError) { |
policy_map.Set(key::kOpenNetworkConfiguration, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kTestONC), |
NULL); |
scoped_ptr<NetworkConfigurationPolicyHandler> handler( |
@@ -306,6 +318,7 @@ TEST(NetworkConfigurationPolicyHandlerTest, Sanitization) { |
policy_map.Set(key::kOpenNetworkConfiguration, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::StringValue(kTestONC), |
NULL); |
scoped_ptr<NetworkConfigurationPolicyHandler> handler( |
@@ -330,7 +343,8 @@ TEST(PinnedLauncherAppsPolicyHandler, PrefTranslation) { |
PinnedLauncherAppsPolicyHandler handler; |
policy_map.Set(key::kPinnedLauncherApps, POLICY_LEVEL_MANDATORY, |
- POLICY_SCOPE_USER, list.DeepCopy(), NULL); |
+ POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, list.DeepCopy(), |
+ nullptr); |
handler.ApplyPolicySettings(policy_map, &prefs); |
EXPECT_TRUE(prefs.GetValue(prefs::kPinnedLauncherApps, &value)); |
EXPECT_TRUE(base::Value::Equals(&expected_pinned_apps, value)); |
@@ -341,7 +355,8 @@ TEST(PinnedLauncherAppsPolicyHandler, PrefTranslation) { |
expected_pinned_apps.Append(entry1_dict); |
list.Append(entry1.DeepCopy()); |
policy_map.Set(key::kPinnedLauncherApps, POLICY_LEVEL_MANDATORY, |
- POLICY_SCOPE_USER, list.DeepCopy(), NULL); |
+ POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, list.DeepCopy(), |
+ nullptr); |
prefs.Clear(); |
handler.ApplyPolicySettings(policy_map, &prefs); |
EXPECT_TRUE(prefs.GetValue(prefs::kPinnedLauncherApps, &value)); |
@@ -361,6 +376,7 @@ TEST_F(LoginScreenPowerManagementPolicyHandlerTest, ValidPolicy) { |
policy_map.Set( |
key::kDeviceLoginScreenPowerManagement, POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
base::JSONReader::Read(kLoginScreenPowerManagementPolicy).release(), |
NULL); |
LoginScreenPowerManagementPolicyHandler handler(chrome_schema_); |
@@ -374,6 +390,7 @@ TEST_F(LoginScreenPowerManagementPolicyHandlerTest, WrongType) { |
policy_map.Set(key::kDeviceLoginScreenPowerManagement, |
POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, |
+ POLICY_SOURCE_CLOUD, |
new base::FundamentalValue(false), |
NULL); |
LoginScreenPowerManagementPolicyHandler handler(chrome_schema_); |