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

Side by Side Diff: chrome/browser/google/google_update_settings_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 | « chrome/browser/first_run/first_run_unittest.cc ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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"
7 #include "base/path_service.h"
8 #include "base/scoped_temp_dir.h"
5 #include "chrome/browser/google/google_util.h" 9 #include "chrome/browser/google/google_util.h"
10 #include "chrome/common/chrome_paths.h"
6 #include "chrome/installer/util/google_update_settings.h" 11 #include "chrome/installer/util/google_update_settings.h"
7 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
8 #include "testing/platform_test.h" 13 #include "testing/platform_test.h"
9 14
10 class GoogleUpdateTest : public PlatformTest { 15 class GoogleUpdateTest : public PlatformTest {
16 protected:
17 GoogleUpdateTest() {}
18 virtual ~GoogleUpdateTest() {}
19
20 virtual void SetUp() OVERRIDE {
21 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
22 PathService::Override(chrome::DIR_USER_DATA, temp_dir_.path());
23 }
24
25 private:
26 ScopedTempDir temp_dir_;
27
28 DISALLOW_COPY_AND_ASSIGN(GoogleUpdateTest);
11 }; 29 };
12 30
13 TEST_F(GoogleUpdateTest, StatsConsent) { 31 TEST_F(GoogleUpdateTest, StatsConsent) {
14 // Stats are off by default. 32 // Stats are off by default.
15 EXPECT_FALSE(GoogleUpdateSettings::GetCollectStatsConsent()); 33 EXPECT_FALSE(GoogleUpdateSettings::GetCollectStatsConsent());
16 // Stats reporting is ON. 34 // Stats reporting is ON.
17 EXPECT_TRUE(GoogleUpdateSettings::SetCollectStatsConsent(true)); 35 EXPECT_TRUE(GoogleUpdateSettings::SetCollectStatsConsent(true));
18 EXPECT_TRUE(GoogleUpdateSettings::GetCollectStatsConsent()); 36 EXPECT_TRUE(GoogleUpdateSettings::GetCollectStatsConsent());
19 // Stats reporting is OFF. 37 // Stats reporting is OFF.
20 EXPECT_TRUE(GoogleUpdateSettings::SetCollectStatsConsent(false)); 38 EXPECT_TRUE(GoogleUpdateSettings::SetCollectStatsConsent(false));
(...skipping 21 matching lines...) Expand all
42 EXPECT_FALSE(google_util::IsOrganicFirstRun("CHMA")); 60 EXPECT_FALSE(google_util::IsOrganicFirstRun("CHMA"));
43 EXPECT_TRUE(google_util::IsOrganicFirstRun("EUBA")); 61 EXPECT_TRUE(google_util::IsOrganicFirstRun("EUBA"));
44 EXPECT_TRUE(google_util::IsOrganicFirstRun("GGRA")); 62 EXPECT_TRUE(google_util::IsOrganicFirstRun("GGRA"));
45 63
46 #if defined(OS_MACOSX) 64 #if defined(OS_MACOSX)
47 // An empty brand string on Mac is used for channels other than stable, 65 // An empty brand string on Mac is used for channels other than stable,
48 // which are always organic. 66 // which are always organic.
49 EXPECT_TRUE(google_util::IsOrganicFirstRun("")); 67 EXPECT_TRUE(google_util::IsOrganicFirstRun(""));
50 #endif 68 #endif
51 } 69 }
OLDNEW
« no previous file with comments | « chrome/browser/first_run/first_run_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698