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

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

Issue 12223062: Support variations_seed parameter in MasterPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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 | « chrome/browser/first_run/first_run_internal.h ('k') | chrome/installer/util/master_preferences.h » ('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
===================================================================
--- chrome/browser/first_run/first_run_unittest.cc (revision 181784)
+++ chrome/browser/first_run/first_run_unittest.cc (working copy)
@@ -10,15 +10,18 @@
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/first_run/first_run_internal.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/installer/util/master_preferences.h"
#include "testing/gtest/include/gtest/gtest.h"
+namespace first_run {
+
class FirstRunTest : public testing::Test {
protected:
FirstRunTest() : user_data_dir_override_(chrome::DIR_USER_DATA) {}
virtual ~FirstRunTest() {}
virtual void SetUp() OVERRIDE {
- first_run::internal::GetFirstRunSentinelFilePath(&sentinel_path_);
+ internal::GetFirstRunSentinelFilePath(&sentinel_path_);
}
base::FilePath sentinel_path_;
@@ -30,9 +33,27 @@
};
TEST_F(FirstRunTest, RemoveSentinel) {
- EXPECT_TRUE(first_run::CreateSentinel());
+ EXPECT_TRUE(CreateSentinel());
EXPECT_TRUE(file_util::PathExists(sentinel_path_));
- EXPECT_TRUE(first_run::RemoveSentinel());
+ EXPECT_TRUE(RemoveSentinel());
EXPECT_FALSE(file_util::PathExists(sentinel_path_));
}
+
+TEST_F(FirstRunTest, SetupMasterPrefsFromInstallPrefs_VariationsSeed) {
+ installer::MasterPreferences install_prefs("{ \"variations_seed\":\"xyz\" }");
+
+ MasterPrefs out_prefs;
+ internal::SetupMasterPrefsFromInstallPrefs(install_prefs, &out_prefs);
+ EXPECT_EQ("xyz", out_prefs.variations_seed);
+}
+
+TEST_F(FirstRunTest, SetupMasterPrefsFromInstallPrefs_NoVariationsSeed) {
+ installer::MasterPreferences install_prefs("{ }");
+
+ MasterPrefs out_prefs;
+ internal::SetupMasterPrefsFromInstallPrefs(install_prefs, &out_prefs);
+ EXPECT_TRUE(out_prefs.variations_seed.empty());
+}
+
+} // namespace first_run
« no previous file with comments | « chrome/browser/first_run/first_run_internal.h ('k') | chrome/installer/util/master_preferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698