diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-06 18:11:15 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-06 18:11:15 +0000 |
commit | 12f520c53db26ec0dc45f263904d8995e809e800 (patch) | |
tree | defcb2b679cc43a1d0ebb85adcda4f606549883d /chrome/browser/shell_integration_unittest.cc | |
parent | a1ca40db95ac3c0dc8c12c42fe736c800d46c00b (diff) | |
download | chromium_src-12f520c53db26ec0dc45f263904d8995e809e800.zip chromium_src-12f520c53db26ec0dc45f263904d8995e809e800.tar.gz chromium_src-12f520c53db26ec0dc45f263904d8995e809e800.tar.bz2 |
Append profile info to win7 app id per issue 30414
Add profile info to app id for non-default profile so that win7 could
group chrome icons based on profile.
- Add a new chrome/common/win_util.h/cc to hold app id functions that
would include profile info for non-default profiles;
- Add unit test to the new GetChromiumAppId function;
- Browser and JumpList to use the GetChromiumAppId for BrowserWindow
and JumpList;
- UserDataManager to use it for shortcuts it creates;
- Make app id for web apps include profile info as well;
- Change web_app::UpdateShortcuts to just update shortcuts description,
icon and app id;
BUG=30414
TEST=Verify fix for issue 30414.
Review URL: http://codereview.chromium.org/506079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35634 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/shell_integration_unittest.cc')
-rw-r--r-- | chrome/browser/shell_integration_unittest.cc | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc index 7133031..e409013 100644 --- a/chrome/browser/shell_integration_unittest.cc +++ b/chrome/browser/shell_integration_unittest.cc @@ -7,6 +7,7 @@ #include "base/file_path.h" #include "base/string_util.h" #include "chrome/common/chrome_constants.h" +#include "chrome/common/chrome_paths_internal.h" #include "googleurl/src/gurl.h" #include "testing/gtest/include/gtest/gtest.h" @@ -170,4 +171,27 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { test_cases[i].icon_name)); } } -#endif // defined(OS_LINUX) +#elif defined(OS_WIN) +TEST(ShellIntegrationTest, GetChromiumAppIdTest) { + // Empty profile path should get chrome::kBrowserAppID + FilePath empty_path; + EXPECT_EQ(std::wstring(chrome::kBrowserAppID), + ShellIntegration::GetChromiumAppId(empty_path)); + + // Default profile path should get chrome::kBrowserAppID + FilePath default_user_data_dir; + chrome::GetDefaultUserDataDirectory(&default_user_data_dir); + FilePath default_profile_path = + default_user_data_dir.Append(chrome::kNotSignedInProfile); + EXPECT_EQ(std::wstring(chrome::kBrowserAppID), + ShellIntegration::GetChromiumAppId(default_profile_path)); + + // Non-default profile path should get chrome::kBrowserAppID joined with + // profile info. + FilePath profile_path(FILE_PATH_LITERAL("root")); + profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); + profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); + EXPECT_EQ(std::wstring(chrome::kBrowserAppID) + L".udd.UserDataTest", + ShellIntegration::GetChromiumAppId(profile_path)); +} +#endif |