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

Unified Diff: chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc

Issue 2570353002: Enabled default policies in Device Local Accounts (Closed)
Patch Set: Created 4 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
« no previous file with comments | « chrome/browser/chromeos/policy/device_local_account_policy_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc
diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc b/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc
index 71d8b4762bb0cba11ec4ca7365ba37ae53c2d263..c6523f9671ece3224a75584457323b0f1328fd70 100644
--- a/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc
+++ b/chrome/browser/chromeos/policy/device_local_account_policy_service_unittest.cc
@@ -824,6 +824,9 @@ void DeviceLocalAccountPolicyProviderTest::SetUp() {
key::kFullscreenAllowed, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
POLICY_SOURCE_PUBLIC_SESSION_OVERRIDE,
base::MakeUnique<base::FundamentalValue>(false), nullptr);
+
+ // Policy defaults (for policies not set by admin).
+ SetEnterpriseUsersDefaults(&expected_policy_map_);
}
void DeviceLocalAccountPolicyProviderTest::TearDown() {
@@ -870,6 +873,16 @@ TEST_F(DeviceLocalAccountPolicyProviderTest, Policy) {
POLICY_DOMAIN_CHROME, std::string())).CopyFrom(expected_policy_map_);
EXPECT_TRUE(expected_policy_bundle.Equals(provider_->policies()));
+ // Make sure the Dinosaur game is disabled by default. This ensures the
+ // default policies have been set in Public Sessions.
+ bool allow_dinosaur_game = true;
+ auto policy_value =
+ provider_->policies()
+ .Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
+ .GetValue(key::kAllowDinosaurEasterEgg);
+ EXPECT_TRUE(policy_value && policy_value->GetAsBoolean(&allow_dinosaur_game));
+ EXPECT_FALSE(allow_dinosaur_game);
+
// Policy change should be reported.
EXPECT_CALL(provider_observer_, OnUpdatePolicy(provider_.get()))
.Times(AtLeast(1));
« no previous file with comments | « chrome/browser/chromeos/policy/device_local_account_policy_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698