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

Unified Diff: chrome/browser/first_run/first_run_unittest.cc

Issue 10909037: Redirect USER_DATA_DIR for GoogleUpdateTest and FirstRunTest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OVERRIDE Created 8 years, 4 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/browser/google/google_update_settings_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run/first_run_unittest.cc
diff --git a/chrome/browser/first_run/first_run_unittest.cc b/chrome/browser/first_run/first_run_unittest.cc
index 601416c95cdb602923a1ff5d8c00e35f7ae7952e..9876d55a612b0dbc7e983b7bb10a7835567b225a 100644
--- a/chrome/browser/first_run/first_run_unittest.cc
+++ b/chrome/browser/first_run/first_run_unittest.cc
@@ -2,18 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "base/file_util.h"
+#include "base/path_service.h"
+#include "base/scoped_temp_dir.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/first_run/first_run_internal.h"
+#include "chrome/common/chrome_paths.h"
#include "testing/gtest/include/gtest/gtest.h"
class FirstRunTest : public testing::Test {
protected:
- virtual void SetUp() {
+ FirstRunTest() {}
+ virtual ~FirstRunTest() {}
+
+ virtual void SetUp() OVERRIDE {
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+ PathService::Override(chrome::DIR_USER_DATA, temp_dir_.path());
first_run::internal::GetFirstRunSentinelFilePath(&sentinel_path_);
}
FilePath sentinel_path_;
+
+ private:
+ ScopedTempDir temp_dir_;
+
+ DISALLOW_COPY_AND_ASSIGN(FirstRunTest);
};
TEST_F(FirstRunTest, RemoveSentinel) {
« no previous file with comments | « no previous file | chrome/browser/google/google_update_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698