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

Unified Diff: chrome/test/base/test_launcher_utils.cc

Issue 2612733003: Machine-local policy files should not affect tests (Closed)
Patch Set: Improve comment Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/base/testing_browser_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/test_launcher_utils.cc
diff --git a/chrome/test/base/test_launcher_utils.cc b/chrome/test/base/test_launcher_utils.cc
index 88926743500e693745885766a43a6d2aec508e4c..7dd5f9251b179a81f0fd104477e81d286edbbfb0 100644
--- a/chrome/test/base/test_launcher_utils.cc
+++ b/chrome/test/base/test_launcher_utils.cc
@@ -106,6 +106,12 @@ bool OverrideUserDataDir(const base::FilePath& user_data_dir) {
// value to the child process. This is the simplest way to do it.
std::unique_ptr<base::Environment> env(base::Environment::Create());
success = success && env->SetVar("XDG_CACHE_HOME", user_data_dir.value());
+
+ // Also make sure that the machine policy directory is inside the clear
+ // profile. Otherwise the machine's policies could affect tests.
+ base::FilePath policy_files = user_data_dir.AppendASCII("policies");
+ success =
+ success && PathService::Override(chrome::DIR_POLICY_FILES, policy_files);
#endif
return success;
« no previous file with comments | « no previous file | chrome/test/base/testing_browser_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698