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

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

Issue 2643833002: Add a New Tab page location group policy (Closed)
Patch Set: Fixed browser tests Created 3 years, 11 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/policy_browsertest.cc
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index ad7e48a26feb825b685b690869c25a3ec362de75..e82b921ffeb84078a03dae5f2cfe32f2b246a1e8 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -1199,9 +1199,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ForceGoogleSafeSearch) {
safe_search == 0 // ForceGoogleSafeSearch
? nullptr
: base::MakeUnique<base::FundamentalValue>(safe_search == 1),
- nullptr, // ForceYouTubeSafetyMode
- nullptr // ForceYouTubeRestrict
- );
+ nullptr, // ForceYouTubeSafetyMode
+ nullptr); // ForceYouTubeRestrict
// Verify that the safe search pref behaves the way we expect.
PrefService* prefs = browser()->profile()->GetPrefs();
@@ -2093,6 +2092,19 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, HomepageLocation) {
EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), contents->GetURL());
}
+IN_PROC_BROWSER_TEST_F(PolicyTest, NewTabPageLocation) {
+ // Verifies that the New Tab page can be configured with policies.
+ PolicyMap policies;
+ policies.Set(key::kNewTabPageLocation, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, POLICY_SOURCE_ENTERPRISE_DEFAULT,
+ base::MakeUnique<base::StringValue>(chrome::kChromeUICreditsURL),
+ nullptr);
+ UpdateProviderPolicy(policies);
+ PrefService* prefs = browser()->profile()->GetPrefs();
+ EXPECT_EQ(chrome::kChromeUICreditsURL,
+ prefs->GetString(prefs::kNewTabPageLocationOverride));
+}
+
#if defined(OS_MACOSX) && defined(ADDRESS_SANITIZER)
// Flaky on ASAN on Mac. See https://crbug.com/674497.
#define MAYBE_IncognitoEnabled DISABLED_IncognitoEnabled

Powered by Google App Engine
This is Rietveld 408576698