OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Unit tests for BrowserDistribution class. | 5 // Unit tests for BrowserDistribution class. |
6 | 6 |
7 #include "chrome/installer/util/browser_distribution.h" | 7 #include "chrome/installer/util/browser_distribution.h" |
8 #include "chrome/installer/util/master_preferences.h" | 8 #include "chrome/installer/util/master_preferences.h" |
9 #include "chrome/installer/util/shell_util.h" | 9 #include "chrome/installer/util/shell_util.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // with the chrome resources so we cannot test official build. | 26 // with the chrome resources so we cannot test official build. |
27 TEST(BrowserDistributionTest, StringsTest) { | 27 TEST(BrowserDistributionTest, StringsTest) { |
28 struct browser_test_type { | 28 struct browser_test_type { |
29 BrowserDistribution::Type type; | 29 BrowserDistribution::Type type; |
30 bool has_com_dlls; | 30 bool has_com_dlls; |
31 } browser_tests[] = { | 31 } browser_tests[] = { |
32 { BrowserDistribution::CHROME_BROWSER, false }, | 32 { BrowserDistribution::CHROME_BROWSER, false }, |
33 { BrowserDistribution::CHROME_FRAME, true }, | 33 { BrowserDistribution::CHROME_FRAME, true }, |
34 }; | 34 }; |
35 | 35 |
36 const installer_util::MasterPreferences& prefs = | 36 const installer::MasterPreferences& prefs = |
37 installer_util::MasterPreferences::ForCurrentProcess(); | 37 installer::MasterPreferences::ForCurrentProcess(); |
38 | 38 |
39 for (int i = 0; i < arraysize(browser_tests); ++i) { | 39 for (int i = 0; i < arraysize(browser_tests); ++i) { |
40 BrowserDistribution* dist = | 40 BrowserDistribution* dist = |
41 BrowserDistribution::GetSpecificDistribution(browser_tests[i].type, | 41 BrowserDistribution::GetSpecificDistribution(browser_tests[i].type, |
42 prefs); | 42 prefs); |
43 ASSERT_TRUE(dist != NULL); | 43 ASSERT_TRUE(dist != NULL); |
44 std::wstring name = dist->GetApplicationName(); | 44 std::wstring name = dist->GetApplicationName(); |
45 EXPECT_FALSE(name.empty()); | 45 EXPECT_FALSE(name.empty()); |
46 std::wstring desc = dist->GetAppDescription(); | 46 std::wstring desc = dist->GetAppDescription(); |
47 EXPECT_FALSE(desc.empty()); | 47 EXPECT_FALSE(desc.empty()); |
(...skipping 13 matching lines...) Expand all Loading... |
61 TEST(BrowserDistributionTest, AlternateAndNormalShortcutName) { | 61 TEST(BrowserDistributionTest, AlternateAndNormalShortcutName) { |
62 std::wstring normal_name; | 62 std::wstring normal_name; |
63 std::wstring alternate_name; | 63 std::wstring alternate_name; |
64 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 64 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
65 EXPECT_TRUE(ShellUtil::GetChromeShortcutName(dist, &normal_name, false)); | 65 EXPECT_TRUE(ShellUtil::GetChromeShortcutName(dist, &normal_name, false)); |
66 EXPECT_TRUE(ShellUtil::GetChromeShortcutName(dist, &alternate_name, true)); | 66 EXPECT_TRUE(ShellUtil::GetChromeShortcutName(dist, &alternate_name, true)); |
67 EXPECT_NE(normal_name, alternate_name); | 67 EXPECT_NE(normal_name, alternate_name); |
68 EXPECT_FALSE(normal_name.empty()); | 68 EXPECT_FALSE(normal_name.empty()); |
69 EXPECT_FALSE(alternate_name.empty()); | 69 EXPECT_FALSE(alternate_name.empty()); |
70 } | 70 } |
OLD | NEW |