Chromium Code Reviews| Index: chrome/installer/util/master_preferences_unittest.cc |
| diff --git a/chrome/installer/util/master_preferences_unittest.cc b/chrome/installer/util/master_preferences_unittest.cc |
| index 019ac57cdf4f1b2806a73a53d8bd1905624305a5..c01313627fc8b1f6a7ad81d1b58811f8a128b18a 100644 |
| --- a/chrome/installer/util/master_preferences_unittest.cc |
| +++ b/chrome/installer/util/master_preferences_unittest.cc |
| @@ -19,6 +19,7 @@ |
| #include "chrome/common/pref_names.h" |
| #include "chrome/installer/util/master_preferences_constants.h" |
| #include "chrome/installer/util/util_constants.h" |
| +#include "rlz/features/features.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| namespace { |
| @@ -89,8 +90,7 @@ TEST_F(MasterPreferencesTest, ParseDistroParams) { |
| " \"make_chrome_default_for_user\": true,\n" |
| " \"system_level\": true,\n" |
| " \"verbose_logging\": true,\n" |
| - " \"require_eula\": true,\n" |
| - " \"ping_delay\": 40\n" |
| + " \"require_eula\": true\n" |
| " },\n" |
| " \"blah\": {\n" |
| " \"import_history\": false\n" |
| @@ -131,11 +131,6 @@ TEST_F(MasterPreferencesTest, ParseDistroParams) { |
| installer::master_preferences::kDistroImportBookmarksFromFilePref, |
| &str_value)); |
| EXPECT_STREQ("c:\\foo", str_value.c_str()); |
| - |
| - int ping_delay = 90; |
| - EXPECT_TRUE(prefs.GetInt(installer::master_preferences::kDistroPingDelay, |
| - &ping_delay)); |
| - EXPECT_EQ(ping_delay, 40); |
| } |
| TEST_F(MasterPreferencesTest, ParseMissingDistroParams) { |
| @@ -186,11 +181,6 @@ TEST_F(MasterPreferencesTest, ParseMissingDistroParams) { |
| EXPECT_FALSE(prefs.GetString( |
| installer::master_preferences::kDistroImportBookmarksFromFilePref, |
| &str_value)); |
| - |
| - int ping_delay = 90; |
| - EXPECT_FALSE(prefs.GetInt( |
| - installer::master_preferences::kDistroPingDelay, &ping_delay)); |
| - EXPECT_EQ(ping_delay, 90); |
| } |
| TEST_F(MasterPreferencesTest, FirstRunTabs) { |
| @@ -324,33 +314,38 @@ TEST_F(MasterPreferencesTest, TestDefaultInstallConfig) { |
| } |
| TEST_F(MasterPreferencesTest, EnforceLegacyCreateAllShortcutsFalse) { |
| - static const char kCreateAllShortcutsFalsePrefs[] = |
| + static const char kLegacyPrefs[] = |
| "{" |
| " \"distribution\": {" |
| - " \"create_all_shortcuts\": false" |
| + " \"create_all_shortcuts\": false,\n" |
| + " \"ping_delay\": 40\n" |
| " }" |
| "}"; |
| - installer::MasterPreferences prefs(kCreateAllShortcutsFalsePrefs); |
| - |
| - bool do_not_create_desktop_shortcut = false; |
| - bool do_not_create_quick_launch_shortcut = false; |
| - bool do_not_create_taskbar_shortcut = false; |
| - prefs.GetBool( |
| - installer::master_preferences::kDoNotCreateDesktopShortcut, |
| - &do_not_create_desktop_shortcut); |
| - prefs.GetBool( |
| - installer::master_preferences::kDoNotCreateQuickLaunchShortcut, |
| - &do_not_create_quick_launch_shortcut); |
| - prefs.GetBool( |
| - installer::master_preferences::kDoNotCreateTaskbarShortcut, |
| - &do_not_create_taskbar_shortcut); |
| - // create_all_shortcuts is a legacy preference that should only enforce |
| - // do_not_create_desktop_shortcut and do_not_create_quick_launch_shortcut |
| - // when set to false. |
| - EXPECT_TRUE(do_not_create_desktop_shortcut); |
| - EXPECT_TRUE(do_not_create_quick_launch_shortcut); |
| - EXPECT_FALSE(do_not_create_taskbar_shortcut); |
| + installer::MasterPreferences prefs(kLegacyPrefs); |
| + |
| + bool do_not_create_desktop_shortcut = false; |
| + bool do_not_create_quick_launch_shortcut = false; |
| + bool do_not_create_taskbar_shortcut = false; |
| + prefs.GetBool(installer::master_preferences::kDoNotCreateDesktopShortcut, |
| + &do_not_create_desktop_shortcut); |
| + prefs.GetBool(installer::master_preferences::kDoNotCreateQuickLaunchShortcut, |
| + &do_not_create_quick_launch_shortcut); |
| + prefs.GetBool(installer::master_preferences::kDoNotCreateTaskbarShortcut, |
| + &do_not_create_taskbar_shortcut); |
| + // create_all_shortcuts is a legacy preference that should only enforce |
| + // do_not_create_desktop_shortcut and do_not_create_quick_launch_shortcut |
| + // when set to false. |
| + EXPECT_TRUE(do_not_create_desktop_shortcut); |
| + EXPECT_TRUE(do_not_create_quick_launch_shortcut); |
| + EXPECT_FALSE(do_not_create_taskbar_shortcut); |
| + |
| +#if BUILDFLAG(ENABLE_RLZ) |
| + int rlz_ping_delay = 0; |
| + EXPECT_TRUE(prefs.master_dictionary().GetInteger(prefs::kRlzPingDelay, |
| + &rlz_ping_delay)); |
| + EXPECT_EQ(40, rlz_ping_delay); |
| +#endif // BUILDFLAG(ENABLE_RLZ) |
|
Roger Tawa OOO till Jul 10th
2017/02/24 16:02:18
Make this its own separate test since it seems wei
gab
2017/02/28 19:54:45
Good catch on the test name being outdated with th
|
| } |
| TEST_F(MasterPreferencesTest, DontEnforceLegacyCreateAllShortcutsTrue) { |