| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 unprotected_prefs_serializer.Serialize(*unprotected_preferences)); | 221 unprotected_prefs_serializer.Serialize(*unprotected_preferences)); |
| 222 | 222 |
| 223 if (protected_preferences) { | 223 if (protected_preferences) { |
| 224 JSONFileValueSerializer protected_prefs_serializer(protected_pref_file); | 224 JSONFileValueSerializer protected_prefs_serializer(protected_pref_file); |
| 225 EXPECT_TRUE(protected_prefs_serializer.Serialize(*protected_preferences)); | 225 EXPECT_TRUE(protected_prefs_serializer.Serialize(*protected_preferences)); |
| 226 } | 226 } |
| 227 | 227 |
| 228 return true; | 228 return true; |
| 229 } | 229 } |
| 230 | 230 |
| 231 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | |
| 232 ExtensionBrowserTest::SetUpInProcessBrowserTestFixture(); | |
| 233 | |
| 234 // Bots are on a domain, turn off the domain check for settings hardening in | |
| 235 // order to be able to test all SettingsEnforcement groups. | |
| 236 chrome_prefs::DisableDelaysAndDomainCheckForTesting(); | |
| 237 } | |
| 238 | |
| 239 // In the PRE_ test, find the number of tracked preferences that were | 231 // In the PRE_ test, find the number of tracked preferences that were |
| 240 // initialized and save it to a file to be read back in the main test and used | 232 // initialized and save it to a file to be read back in the main test and used |
| 241 // as the total number of tracked preferences. | 233 // as the total number of tracked preferences. |
| 242 virtual void SetUpOnMainThread() OVERRIDE { | 234 virtual void SetUpOnMainThread() OVERRIDE { |
| 243 ExtensionBrowserTest::SetUpOnMainThread(); | 235 ExtensionBrowserTest::SetUpOnMainThread(); |
| 244 | 236 |
| 245 // File in which the PRE_ test will save the number of tracked preferences | 237 // File in which the PRE_ test will save the number of tracked preferences |
| 246 // on this platform. | 238 // on this platform. |
| 247 const char kNumTrackedPrefFilename[] = "NumTrackedPrefs"; | 239 const char kNumTrackedPrefFilename[] = "NumTrackedPrefs"; |
| 248 | 240 |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 "Settings.TrackedPreferenceTrustedInitialized", ALLOW_NONE)); | 892 "Settings.TrackedPreferenceTrustedInitialized", ALLOW_NONE)); |
| 901 EXPECT_EQ( | 893 EXPECT_EQ( |
| 902 0, | 894 0, |
| 903 GetTrackedPrefHistogramCount( | 895 GetTrackedPrefHistogramCount( |
| 904 "Settings.TrackedPreferenceMigratedLegacyDeviceId", ALLOW_NONE)); | 896 "Settings.TrackedPreferenceMigratedLegacyDeviceId", ALLOW_NONE)); |
| 905 } | 897 } |
| 906 }; | 898 }; |
| 907 | 899 |
| 908 PREF_HASH_BROWSER_TEST(PrefHashBrowserTestUntrustedAdditionToPrefsAfterWipe, | 900 PREF_HASH_BROWSER_TEST(PrefHashBrowserTestUntrustedAdditionToPrefsAfterWipe, |
| 909 UntrustedAdditionToPrefsAfterWipe); | 901 UntrustedAdditionToPrefsAfterWipe); |
| OLD | NEW |