summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-19 20:29:17 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-19 20:29:17 +0000
commitd6b4f43e5ba0048e2d72c2801c694135d32fa7e4 (patch)
tree049adc435c74c0400eae67f22e6e01979e6fcde7 /chrome
parentc9af00d21e67b4dee15ec54655d30cb9f9139972 (diff)
downloadchromium_src-d6b4f43e5ba0048e2d72c2801c694135d32fa7e4.zip
chromium_src-d6b4f43e5ba0048e2d72c2801c694135d32fa7e4.tar.gz
chromium_src-d6b4f43e5ba0048e2d72c2801c694135d32fa7e4.tar.bz2
Fix CheckFalseTest.CheckFails on Linux after my change to ui_test.
This makes PathService clear its cache after overriding a path. We have many paths depending on each other, so this is necessary to avoid inconsistencies. TEST=ui_tests in Release mode BUG=49838 Review URL: http://codereview.chromium.org/2805100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56738 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/profile_impl.cc14
-rw-r--r--chrome/common/logging_chrome_uitest.cc3
-rw-r--r--chrome/test/ui/ui_test.cc12
3 files changed, 18 insertions, 11 deletions
diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc
index 84a2b17..10ef0e7 100644
--- a/chrome/browser/profile_impl.cc
+++ b/chrome/browser/profile_impl.cc
@@ -305,17 +305,15 @@ ProfileImpl::ProfileImpl(const FilePath& path)
// for a spec on where cache files go. The net effect for most systems is we
// use ~/.cache/chromium/ for Chromium and ~/.cache/google-chrome/ for
// official builds.
- if (!PathService::IsOverridden(chrome::DIR_USER_DATA)) {
#if defined(GOOGLE_CHROME_BUILD)
- const char kCacheDir[] = "google-chrome";
+ const char kCacheDir[] = "google-chrome";
#else
- const char kCacheDir[] = "chromium";
+ const char kCacheDir[] = "chromium";
#endif
- PathService::Get(base::DIR_USER_CACHE, &base_cache_path_);
- base_cache_path_ = base_cache_path_.Append(kCacheDir);
- if (!file_util::PathExists(base_cache_path_))
- file_util::CreateDirectory(base_cache_path_);
- }
+ PathService::Get(base::DIR_USER_CACHE, &base_cache_path_);
+ base_cache_path_ = base_cache_path_.Append(kCacheDir);
+ if (!file_util::PathExists(base_cache_path_))
+ file_util::CreateDirectory(base_cache_path_);
#endif
if (base_cache_path_.empty())
base_cache_path_ = path_;
diff --git a/chrome/common/logging_chrome_uitest.cc b/chrome/common/logging_chrome_uitest.cc
index 328a5a49..216f156 100644
--- a/chrome/common/logging_chrome_uitest.cc
+++ b/chrome/common/logging_chrome_uitest.cc
@@ -130,9 +130,6 @@ class CheckFalseTest : public UITest {
#elif defined(OS_MACOSX)
// Crash service doesn't exist for the Mac yet: http://crbug.com/45243
#define CheckFails DISABLED_CheckFails
-#elif defined(OS_LINUX)
-// TODO(phajdan) Fix this - http://crbug.com/49838
-#define CheckFails FAILS_CheckFails
#endif
// Launch the app in assertion test mode, then close the app.
TEST_F(CheckFalseTest, CheckFails) {
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index b321ebf..2ca1690 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"
@@ -385,6 +386,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()) {