| OLD | NEW |
| 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" | 5 #include "base/basictypes.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/test/scoped_path_override.h" | 9 #include "base/test/scoped_path_override.h" |
| 10 #include "chrome/browser/first_run/first_run.h" | 10 #include "chrome/browser/first_run/first_run.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 base::FilePath sentinel_path_; | 27 base::FilePath sentinel_path_; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 base::ScopedPathOverride user_data_dir_override_; | 30 base::ScopedPathOverride user_data_dir_override_; |
| 31 | 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(FirstRunTest); | 32 DISALLOW_COPY_AND_ASSIGN(FirstRunTest); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 TEST_F(FirstRunTest, RemoveSentinel) { | 35 TEST_F(FirstRunTest, RemoveSentinel) { |
| 36 EXPECT_TRUE(CreateSentinel()); | 36 EXPECT_TRUE(CreateSentinel()); |
| 37 EXPECT_TRUE(file_util::PathExists(sentinel_path_)); | 37 EXPECT_TRUE(base::PathExists(sentinel_path_)); |
| 38 | 38 |
| 39 EXPECT_TRUE(RemoveSentinel()); | 39 EXPECT_TRUE(RemoveSentinel()); |
| 40 EXPECT_FALSE(file_util::PathExists(sentinel_path_)); | 40 EXPECT_FALSE(base::PathExists(sentinel_path_)); |
| 41 } | 41 } |
| 42 | 42 |
| 43 TEST_F(FirstRunTest, SetupMasterPrefsFromInstallPrefs_VariationsSeed) { | 43 TEST_F(FirstRunTest, SetupMasterPrefsFromInstallPrefs_VariationsSeed) { |
| 44 installer::MasterPreferences install_prefs("{ \"variations_seed\":\"xyz\" }"); | 44 installer::MasterPreferences install_prefs("{ \"variations_seed\":\"xyz\" }"); |
| 45 | 45 |
| 46 MasterPrefs out_prefs; | 46 MasterPrefs out_prefs; |
| 47 internal::SetupMasterPrefsFromInstallPrefs(install_prefs, &out_prefs); | 47 internal::SetupMasterPrefsFromInstallPrefs(install_prefs, &out_prefs); |
| 48 EXPECT_EQ("xyz", out_prefs.variations_seed); | 48 EXPECT_EQ("xyz", out_prefs.variations_seed); |
| 49 } | 49 } |
| 50 | 50 |
| 51 TEST_F(FirstRunTest, SetupMasterPrefsFromInstallPrefs_NoVariationsSeed) { | 51 TEST_F(FirstRunTest, SetupMasterPrefsFromInstallPrefs_NoVariationsSeed) { |
| 52 installer::MasterPreferences install_prefs("{ }"); | 52 installer::MasterPreferences install_prefs("{ }"); |
| 53 | 53 |
| 54 MasterPrefs out_prefs; | 54 MasterPrefs out_prefs; |
| 55 internal::SetupMasterPrefsFromInstallPrefs(install_prefs, &out_prefs); | 55 internal::SetupMasterPrefsFromInstallPrefs(install_prefs, &out_prefs); |
| 56 EXPECT_TRUE(out_prefs.variations_seed.empty()); | 56 EXPECT_TRUE(out_prefs.variations_seed.empty()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 } // namespace first_run | 59 } // namespace first_run |
| OLD | NEW |