Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: chrome/browser/prefs/tracked/pref_hash_browsertest.cc

Issue 936483002: Bring back the domain gating check for settings protection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@908473002_ps2
Patch Set: update histogram description Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 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::DisableDomainCheckForTesting();
237 }
238
231 // In the PRE_ test, find the number of tracked preferences that were 239 // In the PRE_ test, find the number of tracked preferences that were
232 // initialized and save it to a file to be read back in the main test and used 240 // initialized and save it to a file to be read back in the main test and used
233 // as the total number of tracked preferences. 241 // as the total number of tracked preferences.
234 void SetUpOnMainThread() override { 242 void SetUpOnMainThread() override {
235 ExtensionBrowserTest::SetUpOnMainThread(); 243 ExtensionBrowserTest::SetUpOnMainThread();
236 244
237 // File in which the PRE_ test will save the number of tracked preferences 245 // File in which the PRE_ test will save the number of tracked preferences
238 // on this platform. 246 // on this platform.
239 const char kNumTrackedPrefFilename[] = "NumTrackedPrefs"; 247 const char kNumTrackedPrefFilename[] = "NumTrackedPrefs";
240 248
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 "Settings.TrackedPreferenceNullInitialized", ALLOW_NONE)); 918 "Settings.TrackedPreferenceNullInitialized", ALLOW_NONE));
911 EXPECT_EQ( 919 EXPECT_EQ(
912 0, 920 0,
913 GetTrackedPrefHistogramCount( 921 GetTrackedPrefHistogramCount(
914 "Settings.TrackedPreferenceMigratedLegacyDeviceId", ALLOW_NONE)); 922 "Settings.TrackedPreferenceMigratedLegacyDeviceId", ALLOW_NONE));
915 } 923 }
916 }; 924 };
917 925
918 PREF_HASH_BROWSER_TEST(PrefHashBrowserTestUntrustedAdditionToPrefsAfterWipe, 926 PREF_HASH_BROWSER_TEST(PrefHashBrowserTestUntrustedAdditionToPrefsAfterWipe,
919 UntrustedAdditionToPrefsAfterWipe); 927 UntrustedAdditionToPrefsAfterWipe);
OLDNEW
« no previous file with comments | « chrome/browser/prefs/chrome_pref_service_factory.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698