Commit 9a9dbcd7 authored by cpu@google.com's avatar cpu@google.com

Final wiring of the distribution strings

- updated unittests

BUG=1640034
BUG=1522969


Review URL: http://codereview.chromium.org/49036

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12567 0039d316-1c4b-4281-b951-d872f2087c98
parent e5dd42d1
...@@ -165,8 +165,9 @@ std::wstring GoogleChromeDistribution::GetApplicationName() { ...@@ -165,8 +165,9 @@ std::wstring GoogleChromeDistribution::GetApplicationName() {
} }
std::wstring GoogleChromeDistribution::GetAlternateApplicationName() { std::wstring GoogleChromeDistribution::GetAlternateApplicationName() {
// TODO(cpu): return the right localized strings when it arrives. const std::wstring& alt_product_name =
return L""; installer_util::GetLocalizedString(IDS_OEM_MAIN_SHORTCUT_NAME_BASE);
return alt_product_name;
} }
std::wstring GoogleChromeDistribution::GetInstallSubDir() { std::wstring GoogleChromeDistribution::GetInstallSubDir() {
...@@ -206,8 +207,9 @@ std::wstring GoogleChromeDistribution::GetPublisherName() { ...@@ -206,8 +207,9 @@ std::wstring GoogleChromeDistribution::GetPublisherName() {
} }
std::wstring GoogleChromeDistribution::GetAppDescription() { std::wstring GoogleChromeDistribution::GetAppDescription() {
// TODO(cpu): Wire the actual localized strings when they arrive. const std::wstring& app_description =
return L""; installer_util::GetLocalizedString(IDS_SHORTCUT_TOOLTIP_BASE);
return app_description;
} }
int GoogleChromeDistribution::GetInstallReturnCode( int GoogleChromeDistribution::GetInstallReturnCode(
......
...@@ -271,20 +271,26 @@ TEST(MasterPreferences, ParseDistroParams) { ...@@ -271,20 +271,26 @@ TEST(MasterPreferences, ParseDistroParams) {
EXPECT_TRUE(file_util::Delete(prefs, false)); EXPECT_TRUE(file_util::Delete(prefs, false));
} }
// The distribution strings should not be empty on chrome or chromium distros.
TEST(BrowserDistribution, StringsTest) { TEST(BrowserDistribution, StringsTest) {
BrowserDistribution *dist = BrowserDistribution::GetDistribution(); BrowserDistribution *dist = BrowserDistribution::GetDistribution();
ASSERT_TRUE(dist != NULL); ASSERT_TRUE(dist != NULL);
std::wstring name = dist->GetApplicationName(); std::wstring name = dist->GetApplicationName();
EXPECT_FALSE(name.empty());
std::wstring desc = dist->GetAppDescription(); std::wstring desc = dist->GetAppDescription();
EXPECT_FALSE(desc.empty());
std::wstring alt_name = dist->GetAlternateApplicationName(); std::wstring alt_name = dist->GetAlternateApplicationName();
// TODO(cpu) finish the test when the translated strings arrive. EXPECT_FALSE(alt_name.empty());
} }
// The shortcut strings obtained by the shell utility functions should not
// be empty or be the same.
TEST(BrowserDistribution, AlternateAndNormalShortcutName) { TEST(BrowserDistribution, AlternateAndNormalShortcutName) {
std::wstring normal_name; std::wstring normal_name;
std::wstring alternate_name; std::wstring alternate_name;
EXPECT_TRUE(ShellUtil::GetChromeShortcutName(&normal_name, false)); EXPECT_TRUE(ShellUtil::GetChromeShortcutName(&normal_name, false));
EXPECT_TRUE(ShellUtil::GetChromeShortcutName(&alternate_name, true)); EXPECT_TRUE(ShellUtil::GetChromeShortcutName(&alternate_name, true));
EXPECT_NE(normal_name, alternate_name); EXPECT_NE(normal_name, alternate_name);
EXPECT_FALSE(normal_name.empty());
EXPECT_FALSE(alternate_name.empty());
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment