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 base::StartsWithASCII( | 312 return base::StartsWith( |
313 testing::UnitTest::GetInstance()->current_test_info()->name(), "PRE_", | 313 testing::UnitTest::GetInstance()->current_test_info()->name(), "PRE_", |
314 true /* case_sensitive */); | 314 base::CompareCase::SENSITIVE); |
315 } | 315 } |
316 | 316 |
317 SettingsProtectionLevel GetProtectionLevelFromTrialGroup( | 317 SettingsProtectionLevel GetProtectionLevelFromTrialGroup( |
318 const std::string& trial_group) { | 318 const std::string& trial_group) { |
319 if (!ProfilePrefStoreManager::kPlatformSupportsPreferenceTracking) | 319 if (!ProfilePrefStoreManager::kPlatformSupportsPreferenceTracking) |
320 return PROTECTION_DISABLED_ON_PLATFORM; | 320 return PROTECTION_DISABLED_ON_PLATFORM; |
321 | 321 |
322 // Protection levels can't be adjusted via --force-fieldtrials in official | 322 // Protection levels can't be adjusted via --force-fieldtrials in official |
323 // builds. | 323 // builds. |
324 #if defined(OFFICIAL_BUILD) | 324 #if defined(OFFICIAL_BUILD) |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 "Settings.TrackedPreferenceNullInitialized", ALLOW_NONE)); | 917 "Settings.TrackedPreferenceNullInitialized", ALLOW_NONE)); |
918 EXPECT_EQ( | 918 EXPECT_EQ( |
919 0, | 919 0, |
920 GetTrackedPrefHistogramCount( | 920 GetTrackedPrefHistogramCount( |
921 "Settings.TrackedPreferenceMigratedLegacyDeviceId", ALLOW_NONE)); | 921 "Settings.TrackedPreferenceMigratedLegacyDeviceId", ALLOW_NONE)); |
922 } | 922 } |
923 }; | 923 }; |
924 | 924 |
925 PREF_HASH_BROWSER_TEST(PrefHashBrowserTestUntrustedAdditionToPrefsAfterWipe, | 925 PREF_HASH_BROWSER_TEST(PrefHashBrowserTestUntrustedAdditionToPrefsAfterWipe, |
926 UntrustedAdditionToPrefsAfterWipe); | 926 UntrustedAdditionToPrefsAfterWipe); |
OLD | NEW |