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

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

Issue 2682833003: Skip ARC initial screen when everything is set up by policy (Closed)
Patch Set: Rebase Created 3 years, 10 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
« no previous file with comments | « chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_browsertest.cc
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index 292b004e65a0ea7e4edcf91a74d61ebaa901b0d7..bade3cf44661088212abf40f58c72024b49ba963 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -4168,13 +4168,17 @@ IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcEnabled) {
// Test ArcBackupRestoreEnabled policy.
IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcBackupRestoreEnabled) {
- const PrefService* const pref = browser()->profile()->GetPrefs();
+ PrefService* const pref = browser()->profile()->GetPrefs();
- // ARC Backup & Restore is switched on by default.
- EXPECT_TRUE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled));
+ // ARC Backup & Restore is switched off by default.
+ EXPECT_FALSE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled));
EXPECT_FALSE(pref->IsManagedPreference(prefs::kArcBackupRestoreEnabled));
- // Disable ARC Backup & Restore.
+ // Switch on ARC Backup & Restore in the user prefs.
+ pref->SetBoolean(prefs::kArcBackupRestoreEnabled, true);
+ EXPECT_TRUE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled));
+
+ // Disable ARC Backup & Restore through the policy.
PolicyMap policies;
policies.Set(key::kArcBackupRestoreEnabled, POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
@@ -4183,7 +4187,7 @@ IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcBackupRestoreEnabled) {
EXPECT_FALSE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled));
EXPECT_TRUE(pref->IsManagedPreference(prefs::kArcBackupRestoreEnabled));
- // Enable ARC Backup & Restore.
+ // Enable ARC Backup & Restore through the policy.
policies.Set(key::kArcBackupRestoreEnabled, POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
base::MakeUnique<base::FundamentalValue>(true), nullptr);
@@ -4195,7 +4199,7 @@ IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcBackupRestoreEnabled) {
// Test ArcLocationServiceEnabled policy and its interplay with the
// DefaultGeolocationSetting policy.
IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcLocationServiceEnabled) {
- const PrefService* const pref = browser()->profile()->GetPrefs();
+ PrefService* const pref = browser()->profile()->GetPrefs();
// Values of the ArcLocationServiceEnabled policy to be tested.
const std::vector<base::Value> test_policy_values = {
@@ -4211,6 +4215,14 @@ IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcLocationServiceEnabled) {
base::FundamentalValue(3), // 'AskGeolocation'
};
+ // The pref is switched off by default.
+ EXPECT_FALSE(pref->GetBoolean(prefs::kArcLocationServiceEnabled));
+ EXPECT_FALSE(pref->IsManagedPreference(prefs::kArcLocationServiceEnabled));
+
+ // Switch on the pref in the user prefs.
+ pref->SetBoolean(prefs::kArcLocationServiceEnabled, true);
+ EXPECT_TRUE(pref->GetBoolean(prefs::kArcLocationServiceEnabled));
+
for (const auto& test_policy_value : test_policy_values) {
for (const auto& test_default_geo_policy_value :
test_default_geo_policy_values) {
« no previous file with comments | « chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698