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 9f756af9ec85b3313013ef1d4510d83217b28d20..459dc1c5d425169d59757f35a1497a5c5c19b59a 100644 |
| --- a/chrome/installer/util/master_preferences_unittest.cc |
| +++ b/chrome/installer/util/master_preferences_unittest.cc |
| @@ -58,6 +58,8 @@ TEST_F(MasterPreferencesTest, ParseDistroParams) { |
| " \"import_home_page\": true,\n" |
| " \"do_not_create_desktop_shortcut\": true,\n" |
| " \"do_not_create_quick_launch_shortcut\": true,\n" |
| + " \"do_not_create_taskbar_shortcut\": true,\n" |
| + " \"do_not_create_any_shortcuts\": true,\n" |
|
gab
2013/03/06 20:20:32
(order as in declaration)
Joao da Silva
2013/03/06 21:21:33
Done.
|
| " \"do_not_launch_chrome\": true,\n" |
| " \"make_chrome_default\": true,\n" |
| " \"make_chrome_default_for_user\": true,\n" |
| @@ -84,6 +86,8 @@ TEST_F(MasterPreferencesTest, ParseDistroParams) { |
| installer::master_preferences::kDistroImportHomePagePref, |
| installer::master_preferences::kDoNotCreateDesktopShortcut, |
| installer::master_preferences::kDoNotCreateQuickLaunchShortcut, |
| + installer::master_preferences::kDoNotCreateTaskbarShortcut, |
| + installer::master_preferences::kDoNotCreateAnyShortcuts, |
|
gab
2013/03/06 20:20:32
(same here)
Joao da Silva
2013/03/06 21:21:33
Done.
|
| installer::master_preferences::kDoNotLaunchChrome, |
| installer::master_preferences::kMakeChromeDefault, |
| installer::master_preferences::kMakeChromeDefaultForUser, |
| @@ -358,14 +362,19 @@ TEST_F(MasterPreferencesTest, EnforceLegacyCreateAllShortcutsFalse) { |
| 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); |
| EXPECT_TRUE(do_not_create_desktop_shortcut); |
| EXPECT_TRUE(do_not_create_quick_launch_shortcut); |
| + EXPECT_FALSE(do_not_create_taskbar_shortcut); |
|
gab
2013/03/06 20:20:32
Add a comment above the 3 expectations explicitly
Joao da Silva
2013/03/06 21:21:33
Done.
|
| } |
| TEST_F(MasterPreferencesTest, DontEnforceLegacyCreateAllShortcutsTrue) { |
| @@ -380,14 +389,19 @@ TEST_F(MasterPreferencesTest, DontEnforceLegacyCreateAllShortcutsTrue) { |
| 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); |
| EXPECT_FALSE(do_not_create_desktop_shortcut); |
| EXPECT_FALSE(do_not_create_quick_launch_shortcut); |
| + EXPECT_FALSE(do_not_create_taskbar_shortcut); |
| } |
| TEST_F(MasterPreferencesTest, DontEnforceLegacyCreateAllShortcutsNotSpecified) { |
| @@ -402,12 +416,51 @@ TEST_F(MasterPreferencesTest, DontEnforceLegacyCreateAllShortcutsNotSpecified) { |
| 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); |
| EXPECT_FALSE(do_not_create_desktop_shortcut); |
| EXPECT_FALSE(do_not_create_quick_launch_shortcut); |
| + EXPECT_FALSE(do_not_create_taskbar_shortcut); |
| +} |
| + |
| +TEST_F(MasterPreferencesTest, |
|
gab
2013/03/06 20:20:32
"create_all_shortcuts" is an old preference that h
Joao da Silva
2013/03/06 21:21:33
That's right, removed.
|
| + DontCreateAnyShortcutsOverridesCreateAllShortcuts) { |
| + static const char kMasterPrefsString[] = |
| + "{" |
| + " \"distribution\": {" |
| + " \"create_all_shortcuts\": true," |
| + " \"do_not_create_any_shortcuts\": true" |
| + " }" |
| + "}"; |
| + |
| + installer::MasterPreferences prefs(kMasterPrefsString); |
| + |
| + bool do_not_create_desktop_shortcut = false; |
| + bool do_not_create_quick_launch_shortcut = false; |
| + bool do_not_create_taskbar_shortcut = false; |
| + bool do_not_create_any_shortcuts = 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); |
| + prefs.GetBool( |
| + installer::master_preferences::kDoNotCreateAnyShortcuts, |
| + &do_not_create_any_shortcuts); |
| + EXPECT_TRUE(do_not_create_desktop_shortcut); |
| + EXPECT_TRUE(do_not_create_quick_launch_shortcut); |
| + EXPECT_TRUE(do_not_create_taskbar_shortcut); |
| + EXPECT_TRUE(do_not_create_any_shortcuts); |
| } |