diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-02 22:29:29 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-02 22:29:29 +0000 |
commit | 0cac83aa1536b90dd25db93808c4371c675e4cf2 (patch) | |
tree | 542e74301e2ffed45fac848d5e3e0035f6c78a92 /chrome/installer | |
parent | 8654036d617cd47db19b21a8c6cafb9c6bbf29f1 (diff) | |
download | chromium_src-0cac83aa1536b90dd25db93808c4371c675e4cf2.zip chromium_src-0cac83aa1536b90dd25db93808c4371c675e4cf2.tar.gz chromium_src-0cac83aa1536b90dd25db93808c4371c675e4cf2.tar.bz2 |
Fix distribution test that fails in official build
- the unit test does not contain the desired resources
- test only on chromium for now
BUG=9637
Review URL: http://codereview.chromium.org/60067
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13043 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/util/google_chrome_distribution_unittest.cc | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/chrome/installer/util/google_chrome_distribution_unittest.cc b/chrome/installer/util/google_chrome_distribution_unittest.cc index 0682c11..6abfe38 100644 --- a/chrome/installer/util/google_chrome_distribution_unittest.cc +++ b/chrome/installer/util/google_chrome_distribution_unittest.cc @@ -228,6 +228,31 @@ TEST_F(GoogleChromeDistributionTest, TestExtractUninstallMetrics) { EXPECT_EQ(expected_url_string, uninstall_metrics_string); } +#else +// The distribution strings should not be empty. The unit tests are not linking +// with the chrome resources so we cannot test official build. +TEST(BrowserDistribution, StringsTest) { + BrowserDistribution *dist = BrowserDistribution::GetDistribution(); + ASSERT_TRUE(dist != NULL); + std::wstring name = dist->GetApplicationName(); + EXPECT_FALSE(name.empty()); + std::wstring desc = dist->GetAppDescription(); + EXPECT_FALSE(desc.empty()); + std::wstring alt_name = dist->GetAlternateApplicationName(); + 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) { + std::wstring normal_name; + std::wstring alternate_name; + EXPECT_TRUE(ShellUtil::GetChromeShortcutName(&normal_name, false)); + EXPECT_TRUE(ShellUtil::GetChromeShortcutName(&alternate_name, true)); + EXPECT_NE(normal_name, alternate_name); + EXPECT_FALSE(normal_name.empty()); + EXPECT_FALSE(alternate_name.empty()); +} #endif TEST(MasterPreferences, ParseDistroParams) { @@ -271,26 +296,3 @@ TEST(MasterPreferences, ParseDistroParams) { EXPECT_TRUE(file_util::Delete(prefs, false)); } -// The distribution strings should not be empty on chrome or chromium distros. -TEST(BrowserDistribution, StringsTest) { - BrowserDistribution *dist = BrowserDistribution::GetDistribution(); - ASSERT_TRUE(dist != NULL); - std::wstring name = dist->GetApplicationName(); - EXPECT_FALSE(name.empty()); - std::wstring desc = dist->GetAppDescription(); - EXPECT_FALSE(desc.empty()); - std::wstring alt_name = dist->GetAlternateApplicationName(); - 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) { - std::wstring normal_name; - std::wstring alternate_name; - EXPECT_TRUE(ShellUtil::GetChromeShortcutName(&normal_name, false)); - EXPECT_TRUE(ShellUtil::GetChromeShortcutName(&alternate_name, true)); - EXPECT_NE(normal_name, alternate_name); - EXPECT_FALSE(normal_name.empty()); - EXPECT_FALSE(alternate_name.empty()); -} |