Index: chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc |
diff --git a/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc b/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc |
index 47bda74704d155139e45d553db64f2464a22ac0b..d1477246ada8498a165f5ad526738e393938a97f 100644 |
--- a/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc |
+++ b/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc |
@@ -236,6 +236,26 @@ TEST_F(ProfileShortcutManagerTest, ShortcutFilename) { |
distribution_)); |
} |
+TEST_F(ProfileShortcutManagerTest, ShortcutLongFilenameIsTrimmed) { |
+ const string16 kLongProfileName = L"Harry Harry Harry Harry Harry Harry Harry" |
+ L"Harry Harry Harry Harry Harry Harry Harry Harry Harry Harry Harry" |
+ L"Harry Harry Harry Harry Harry Harry Harry Harry Harry Harry Harry"; |
+ string16 file_name = |
+ profiles::internal::GetShortcutFilenameForProfile( |
+ kLongProfileName, distribution_); |
+ EXPECT_LT(file_name.size(), kLongProfileName.size()); |
+} |
+ |
+TEST_F(ProfileShortcutManagerTest, ShortcutFilenameStripsReservedCharacters) { |
+ const string16 kProfileName = L"<Harry/>"; |
+ const string16 kSanitizedProfileName = L"Harry"; |
+ const string16 expected_name = kSanitizedProfileName + L" - " + |
+ distribution_->GetAppShortCutName() + installer::kLnkExt; |
+ EXPECT_EQ(expected_name, |
+ profiles::internal::GetShortcutFilenameForProfile(kProfileName, |
+ distribution_)); |
+} |
+ |
TEST_F(ProfileShortcutManagerTest, UnbadgedShortcutFilename) { |
EXPECT_EQ(distribution_->GetAppShortCutName() + installer::kLnkExt, |
profiles::internal::GetShortcutFilenameForProfile(string16(), |