Commit 589fdd61 authored by gab@chromium.org's avatar gab@chromium.org

Add integration browser tests for settings hardening.

This CL introduces the PrefHashBrowserTestBase fixture which these tests are based on.

This fixture (in conjunction with the new PREF_HASH_BROWSER_TEST macro) provides an easy way to override 3 methods in order to:
 1) Setup Chrome as desired in a PRE_ test.
 2) Attack Preferences while Chrome isn't running.
 3) Relaunch Chrome and verify reaction to attacks.

The fixture+macro also parametrizes every test such that they are ran in every SettingsEnforcement trial group.

A few pieces were resurrected from the old PrefHashBrowserTest used to test unloaded profile seeding prior to http://crrev.com/277209

Review URL: https://codereview.chromium.org/431973002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287689 0039d316-1c4b-4281-b951-d872f2087c98
parent e03dc01d
...@@ -241,7 +241,8 @@ SettingsEnforcementGroup GetSettingsEnforcementGroup() { ...@@ -241,7 +241,8 @@ SettingsEnforcementGroup GetSettingsEnforcementGroup() {
// Use the strongest enforcement setting in the absence of a field trial // Use the strongest enforcement setting in the absence of a field trial
// config on Windows. Remember to update the OFFICIAL_BUILD section of // config on Windows. Remember to update the OFFICIAL_BUILD section of
// extension_startup_browsertest.cc when updating the default value below. // extension_startup_browsertest.cc and pref_hash_browsertest.cc when updating
// the default value below.
// TODO(gab): Enforce this on all platforms. // TODO(gab): Enforce this on all platforms.
SettingsEnforcementGroup enforcement_group = SettingsEnforcementGroup enforcement_group =
#if defined(OS_WIN) #if defined(OS_WIN)
...@@ -407,6 +408,8 @@ namespace chrome_prefs { ...@@ -407,6 +408,8 @@ namespace chrome_prefs {
namespace internals { namespace internals {
// Group modifications should be reflected in first_run_browsertest.cc and
// pref_hash_browsertest.cc.
const char kSettingsEnforcementTrialName[] = "SettingsEnforcement"; const char kSettingsEnforcementTrialName[] = "SettingsEnforcement";
const char kSettingsEnforcementGroupNoEnforcement[] = "no_enforcement"; const char kSettingsEnforcementGroupNoEnforcement[] = "no_enforcement";
const char kSettingsEnforcementGroupEnforceAlways[] = "enforce_always"; const char kSettingsEnforcementGroupEnforceAlways[] = "enforce_always";
......
This diff is collapsed.
...@@ -1317,6 +1317,7 @@ ...@@ -1317,6 +1317,7 @@
'browser/prefs/pref_functional_browsertest.cc', 'browser/prefs/pref_functional_browsertest.cc',
'browser/prefs/pref_service_browsertest.cc', 'browser/prefs/pref_service_browsertest.cc',
'browser/prefs/synced_pref_change_registrar_browsertest.cc', 'browser/prefs/synced_pref_change_registrar_browsertest.cc',
'browser/prefs/tracked/pref_hash_browsertest.cc',
'browser/prerender/prerender_browsertest.cc', 'browser/prerender/prerender_browsertest.cc',
'browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc', 'browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc',
'browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc', 'browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment