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

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

Issue 2612733003: Machine-local policy files should not affect tests (Closed)
Patch Set: browser tests: Don't try to create the policy dir 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
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");
Paweł Hajdan Jr. 2017/01/05 15:48:02 Why is this in POSIX non-OSX #ifdef?
pmarko 2017/01/05 16:07:53 That's because chrome_paths.h actually defines DIR
+ 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') | chrome/test/base/testing_browser_process.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698