| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // orchestrated in AttackPreferencesOnDisk(). | 302 // orchestrated in AttackPreferencesOnDisk(). |
| 303 virtual void VerifyReactionToPrefAttack() = 0; | 303 virtual void VerifyReactionToPrefAttack() = 0; |
| 304 | 304 |
| 305 int num_tracked_prefs() const { return num_tracked_prefs_; } | 305 int num_tracked_prefs() const { return num_tracked_prefs_; } |
| 306 | 306 |
| 307 const SettingsProtectionLevel protection_level_; | 307 const SettingsProtectionLevel protection_level_; |
| 308 | 308 |
| 309 private: | 309 private: |
| 310 // Returns true if this is the PRE_ phase of the test. | 310 // Returns true if this is the PRE_ phase of the test. |
| 311 bool IsPRETest() { | 311 bool IsPRETest() { |
| 312 return StartsWithASCII( | 312 return base::StartsWithASCII( |
| 313 testing::UnitTest::GetInstance()->current_test_info()->name(), | 313 testing::UnitTest::GetInstance()->current_test_info()->name(), "PRE_", |
| 314 "PRE_", | |
| 315 true /* case_sensitive */); | 314 true /* case_sensitive */); |
| 316 } | 315 } |
| 317 | 316 |
| 318 SettingsProtectionLevel GetProtectionLevelFromTrialGroup( | 317 SettingsProtectionLevel GetProtectionLevelFromTrialGroup( |
| 319 const std::string& trial_group) { | 318 const std::string& trial_group) { |
| 320 if (!ProfilePrefStoreManager::kPlatformSupportsPreferenceTracking) | 319 if (!ProfilePrefStoreManager::kPlatformSupportsPreferenceTracking) |
| 321 return PROTECTION_DISABLED_ON_PLATFORM; | 320 return PROTECTION_DISABLED_ON_PLATFORM; |
| 322 | 321 |
| 323 // Protection levels can't be adjusted via --force-fieldtrials in official | 322 // Protection levels can't be adjusted via --force-fieldtrials in official |
| 324 // builds. | 323 // builds. |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 "Settings.TrackedPreferenceNullInitialized", ALLOW_NONE)); | 917 "Settings.TrackedPreferenceNullInitialized", ALLOW_NONE)); |
| 919 EXPECT_EQ( | 918 EXPECT_EQ( |
| 920 0, | 919 0, |
| 921 GetTrackedPrefHistogramCount( | 920 GetTrackedPrefHistogramCount( |
| 922 "Settings.TrackedPreferenceMigratedLegacyDeviceId", ALLOW_NONE)); | 921 "Settings.TrackedPreferenceMigratedLegacyDeviceId", ALLOW_NONE)); |
| 923 } | 922 } |
| 924 }; | 923 }; |
| 925 | 924 |
| 926 PREF_HASH_BROWSER_TEST(PrefHashBrowserTestUntrustedAdditionToPrefsAfterWipe, | 925 PREF_HASH_BROWSER_TEST(PrefHashBrowserTestUntrustedAdditionToPrefsAfterWipe, |
| 927 UntrustedAdditionToPrefsAfterWipe); | 926 UntrustedAdditionToPrefsAfterWipe); |
| OLD | NEW |