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

Unified Diff: chrome/test/ui/ui_test.cc

Issue 2805100: Fix CheckFalseTest.CheckFails on Linux after my change to ui_test. (Closed)
Patch Set: final Created 10 years, 3 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
« chrome/browser/profile_impl.cc ('K') | « chrome/common/logging_chrome_uitest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui/ui_test.cc
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index 9cb4fda103d00f18725b1932d1c92fbb5dd3bb25..5e55e6b425a50e7862ce9a14fc3a55cda31052ba 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -15,6 +15,7 @@
#include "app/sql/connection.h"
#include "base/base_switches.h"
#include "base/command_line.h"
+#include "base/environment.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
@@ -414,6 +415,17 @@ void UITestBase::LaunchBrowser(const CommandLine& arguments,
// side. Using PathService seems to be the most reliable, consistent way
// to do that.
ASSERT_TRUE(PathService::Override(chrome::DIR_USER_DATA, user_data_dir()));
+
+#if defined(OS_LINUX)
+ // Make sure the cache directory is inside our clear profile. Otherwise
+ // the cache may contain data from earlier tests that could break the
+ // current test.
+ //
+ // Note: we use an environment variable here, because we have to pass the
+ // value to the child process. This is the simplest way to do it.
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ env->SetVar("XDG_CACHE_HOME", user_data_dir().value());
+#endif
}
if (!template_user_data_.empty()) {
« chrome/browser/profile_impl.cc ('K') | « chrome/common/logging_chrome_uitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698