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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/google/google_update_settings_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h"
5 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/path_service.h"
9 #include "base/scoped_temp_dir.h"
6 #include "chrome/browser/first_run/first_run.h" 10 #include "chrome/browser/first_run/first_run.h"
7 #include "chrome/browser/first_run/first_run_internal.h" 11 #include "chrome/browser/first_run/first_run_internal.h"
12 #include "chrome/common/chrome_paths.h"
8 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
9 14
10 class FirstRunTest : public testing::Test { 15 class FirstRunTest : public testing::Test {
11 protected: 16 protected:
12 virtual void SetUp() { 17 FirstRunTest() {}
18 virtual ~FirstRunTest() {}
19
20 virtual void SetUp() OVERRIDE {
21 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
22 PathService::Override(chrome::DIR_USER_DATA, temp_dir_.path());
13 first_run::internal::GetFirstRunSentinelFilePath(&sentinel_path_); 23 first_run::internal::GetFirstRunSentinelFilePath(&sentinel_path_);
14 } 24 }
15 25
16 FilePath sentinel_path_; 26 FilePath sentinel_path_;
27
28 private:
29 ScopedTempDir temp_dir_;
30
31 DISALLOW_COPY_AND_ASSIGN(FirstRunTest);
17 }; 32 };
18 33
19 TEST_F(FirstRunTest, RemoveSentinel) { 34 TEST_F(FirstRunTest, RemoveSentinel) {
20 EXPECT_TRUE(first_run::CreateSentinel()); 35 EXPECT_TRUE(first_run::CreateSentinel());
21 EXPECT_TRUE(file_util::PathExists(sentinel_path_)); 36 EXPECT_TRUE(file_util::PathExists(sentinel_path_));
22 37
23 EXPECT_TRUE(first_run::RemoveSentinel()); 38 EXPECT_TRUE(first_run::RemoveSentinel());
24 EXPECT_FALSE(file_util::PathExists(sentinel_path_)); 39 EXPECT_FALSE(file_util::PathExists(sentinel_path_));
25 } 40 }
OLDNEW
« 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