summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util/master_preferences_unittest.cc
diff options
context:
space:
mode:
authorhuanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 22:01:25 +0000
committerhuanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 22:01:25 +0000
commit594f4ff352685bb83b71d1402264bc2cf2116e67 (patch)
tree6f1807217f5e8bc50603e5b20008e7160d49dbe7 /chrome/installer/util/master_preferences_unittest.cc
parent26b0f376d66975c03c3d24afd72257f34c9bb5f6 (diff)
downloadchromium_src-594f4ff352685bb83b71d1402264bc2cf2116e67.zip
chromium_src-594f4ff352685bb83b71d1402264bc2cf2116e67.tar.gz
chromium_src-594f4ff352685bb83b71d1402264bc2cf2116e67.tar.bz2
Add import_bookmarks_from_file option to master pref that
sliently import bookmarks from file in first run. BUG=32728 TEST=unit test Review URL: http://codereview.chromium.org/1257001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/master_preferences_unittest.cc')
-rw-r--r--chrome/installer/util/master_preferences_unittest.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/installer/util/master_preferences_unittest.cc b/chrome/installer/util/master_preferences_unittest.cc
index 65fcc6d..ba91cbc 100644
--- a/chrome/installer/util/master_preferences_unittest.cc
+++ b/chrome/installer/util/master_preferences_unittest.cc
@@ -40,6 +40,7 @@ TEST_F(MasterPreferencesTest, ParseDistroParams) {
" \"import_search_engine\": true,\n"
" \"import_history\": true,\n"
" \"import_bookmarks\": true,\n"
+ " \"import_bookmarks_from_file\": \"c:\\\\foo\",\n"
" \"import_home_page\": true,\n"
" \"create_all_shortcuts\": true,\n"
" \"do_not_launch_chrome\": true,\n"
@@ -79,6 +80,11 @@ TEST_F(MasterPreferencesTest, ParseDistroParams) {
EXPECT_TRUE(installer_util::GetDistroBooleanPreference(prefs.get(),
installer_util::master_preferences::kDistroImportBookmarksPref, &value) &&
value);
+ std::wstring str_value;
+ EXPECT_TRUE(installer_util::GetDistroStringPreference(prefs.get(),
+ installer_util::master_preferences::kDistroImportBookmarksFromFilePref,
+ &str_value));
+ EXPECT_STREQ(L"c:\\foo", str_value.c_str());
EXPECT_TRUE(installer_util::GetDistroBooleanPreference(prefs.get(),
installer_util::master_preferences::kDistroImportHomePagePref, &value) &&
value);
@@ -130,6 +136,7 @@ TEST_F(MasterPreferencesTest, ParseMissingDistroParams) {
" \"skip_first_run_ui\": true,\n"
" \"import_search_engine\": true,\n"
" \"import_bookmarks\": false,\n"
+ " \"import_bookmarks_from_file\": \"\",\n"
" \"create_all_shortcuts\": true,\n"
" \"do_not_launch_chrome\": true,\n"
" \"chrome_shortcut_icon_index\": \"bac\"\n"
@@ -155,6 +162,10 @@ TEST_F(MasterPreferencesTest, ParseMissingDistroParams) {
EXPECT_TRUE(installer_util::GetDistroBooleanPreference(prefs.get(),
installer_util::master_preferences::kDistroImportBookmarksPref, &value));
EXPECT_FALSE(value);
+ std::wstring str_value;
+ EXPECT_FALSE(installer_util::GetDistroStringPreference(prefs.get(),
+ installer_util::master_preferences::kDistroImportBookmarksFromFilePref,
+ &str_value));
EXPECT_FALSE(installer_util::GetDistroBooleanPreference(prefs.get(),
installer_util::master_preferences::kDistroImportHomePagePref, &value));