| Index: chrome/browser/policy/policy_prefs_browsertest.cc
|
| diff --git a/chrome/browser/policy/policy_prefs_browsertest.cc b/chrome/browser/policy/policy_prefs_browsertest.cc
|
| index d7f2b93c48d9db1867164c213bd58f2a3f01488e..4235de5090d21fdd385ee91a0411da6bcc02ed95 100644
|
| --- a/chrome/browser/policy/policy_prefs_browsertest.cc
|
| +++ b/chrome/browser/policy/policy_prefs_browsertest.cc
|
| @@ -32,6 +32,7 @@
|
| #include "chrome/browser/search_engines/template_url_service_factory.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/tabs/tab_strip_model.h"
|
| +#include "chrome/common/url_constants.h"
|
| #include "chrome/test/base/in_process_browser_test.h"
|
| #include "chrome/test/base/search_test_utils.h"
|
| #include "chrome/test/base/ui_test_utils.h"
|
| @@ -58,8 +59,6 @@ namespace policy {
|
|
|
| namespace {
|
|
|
| -const char kMainSettingsPage[] = "chrome://settings-frame";
|
| -
|
| const char kCrosSettingsPrefix[] = "cros.";
|
|
|
| std::string GetPolicyName(const std::string& policy_name_decorated) {
|
| @@ -375,6 +374,8 @@ class PolicyTestCases {
|
| DISALLOW_COPY_AND_ASSIGN(PolicyTestCases);
|
| };
|
|
|
| +#if defined(OS_CHROMEOS)
|
| +
|
| // Returns a pseudo-random integer distributed in [0, range).
|
| int GetRandomNumber(int range) {
|
| return rand() % range;
|
| @@ -480,6 +481,8 @@ void VerifyControlledSettingIndicators(Browser* browser,
|
| }
|
| }
|
|
|
| +#endif // defined(OS_CHROMEOS)
|
| +
|
| } // namespace
|
|
|
| typedef InProcessBrowserTest PolicyPrefsTestCoverageTest;
|
| @@ -604,6 +607,8 @@ class PolicyPrefIndicatorTest
|
| public testing::WithParamInterface<std::vector<std::string> > {
|
| };
|
|
|
| +#if defined(OS_CHROMEOS)
|
| +
|
| // Verifies that controlled setting indicators correctly show whether a pref's
|
| // value is recommended or enforced by a corresponding policy.
|
| IN_PROC_BROWSER_TEST_P(PolicyPrefIndicatorTest, CheckPolicyIndicators) {
|
| @@ -611,7 +616,8 @@ IN_PROC_BROWSER_TEST_P(PolicyPrefIndicatorTest, CheckPolicyIndicators) {
|
| PrefService* local_state = g_browser_process->local_state();
|
| PrefService* user_prefs = browser()->profile()->GetPrefs();
|
|
|
| - ui_test_utils::NavigateToURL(browser(), GURL(kMainSettingsPage));
|
| + ui_test_utils::NavigateToURL(browser(),
|
| + GURL(chrome::kChromeUISettingsFrameURL));
|
|
|
| for (std::vector<std::string>::const_iterator policy = GetParam().begin();
|
| policy != GetParam().end();
|
| @@ -763,8 +769,10 @@ IN_PROC_BROWSER_TEST_P(PolicyPrefIndicatorTest, CheckPolicyIndicators) {
|
| prefs->ClearPref(pref_mapping->pref().c_str());
|
| }
|
|
|
| - if (!pref_mapping->indicator_test_url().empty())
|
| - ui_test_utils::NavigateToURL(browser(), GURL(kMainSettingsPage));
|
| + if (!pref_mapping->indicator_test_url().empty()) {
|
| + ui_test_utils::NavigateToURL(browser(),
|
| + GURL(chrome::kChromeUISettingsFrameURL));
|
| + }
|
| }
|
| }
|
| }
|
| @@ -774,4 +782,6 @@ INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance,
|
| PolicyPrefIndicatorTest,
|
| testing::ValuesIn(SplitPoliciesIntoChunks(10)));
|
|
|
| +#endif // defined(OS_CHROMEOS)
|
| +
|
| } // namespace policy
|
|
|