OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/installer/setup/install.h" | 5 #include "chrome/installer/setup/install.h" |
6 | 6 |
7 #include <objbase.h> | 7 #include <objbase.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 " <VisualElements\r\n" | 95 " <VisualElements\r\n" |
96 " ShowNameOnSquare150x150Logo='on'\r\n" | 96 " ShowNameOnSquare150x150Logo='on'\r\n" |
97 " Square150x150Logo='0.0.0.0\\VisualElements\\Logo.png'\r\n" | 97 " Square150x150Logo='0.0.0.0\\VisualElements\\Logo.png'\r\n" |
98 " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n" | 98 " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n" |
99 " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n" | 99 " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n" |
100 " ForegroundText='light'\r\n" | 100 " ForegroundText='light'\r\n" |
101 " BackgroundColor='#212121'/>\r\n" | 101 " BackgroundColor='#212121'/>\r\n" |
102 "</Application>\r\n"; | 102 "</Application>\r\n"; |
103 | 103 |
104 #if defined(GOOGLE_CHROME_BUILD) | 104 #if defined(GOOGLE_CHROME_BUILD) |
| 105 constexpr char kExpectedBetaManifest[] = |
| 106 "<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n" |
| 107 " <VisualElements\r\n" |
| 108 " ShowNameOnSquare150x150Logo='on'\r\n" |
| 109 " Square150x150Logo='0.0.0.0\\VisualElements\\LogoBeta.png'\r\n" |
| 110 " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoBeta.png'\r\n" |
| 111 " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoBeta.png'\r\n" |
| 112 " ForegroundText='light'\r\n" |
| 113 " BackgroundColor='#212121'/>\r\n" |
| 114 "</Application>\r\n"; |
| 115 |
| 116 constexpr char kExpectedDevManifest[] = |
| 117 "<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n" |
| 118 " <VisualElements\r\n" |
| 119 " ShowNameOnSquare150x150Logo='on'\r\n" |
| 120 " Square150x150Logo='0.0.0.0\\VisualElements\\LogoDev.png'\r\n" |
| 121 " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoDev.png'\r\n" |
| 122 " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoDev.png'\r\n" |
| 123 " ForegroundText='light'\r\n" |
| 124 " BackgroundColor='#212121'/>\r\n" |
| 125 "</Application>\r\n"; |
| 126 |
105 constexpr char kExpectedCanaryManifest[] = | 127 constexpr char kExpectedCanaryManifest[] = |
106 "<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n" | 128 "<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n" |
107 " <VisualElements\r\n" | 129 " <VisualElements\r\n" |
108 " ShowNameOnSquare150x150Logo='on'\r\n" | 130 " ShowNameOnSquare150x150Logo='on'\r\n" |
109 " Square150x150Logo='0.0.0.0\\VisualElements\\LogoCanary.png'\r\n" | 131 " Square150x150Logo='0.0.0.0\\VisualElements\\LogoCanary.png'\r\n" |
110 " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoCanary.png'\r\n" | 132 " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoCanary.png'\r\n" |
111 " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoCanary.png'\r\n" | 133 " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoCanary.png'\r\n" |
112 " ForegroundText='light'\r\n" | 134 " ForegroundText='light'\r\n" |
113 " BackgroundColor='#212121'/>\r\n" | 135 " BackgroundColor='#212121'/>\r\n" |
114 "</Application>\r\n"; | 136 "</Application>\r\n"; |
115 | 137 |
116 INSTANTIATE_TEST_CASE_P( | 138 INSTANTIATE_TEST_CASE_P( |
117 GoogleChrome, | 139 GoogleChrome, |
118 CreateVisualElementsManifestTest, | 140 CreateVisualElementsManifestTest, |
119 testing::Combine(testing::Values(install_static::STABLE_INDEX), | 141 testing::Combine(testing::Values(install_static::STABLE_INDEX), |
120 testing::Values(kExpectedPrimaryManifest))); | 142 testing::Values(kExpectedPrimaryManifest))); |
121 INSTANTIATE_TEST_CASE_P( | 143 INSTANTIATE_TEST_CASE_P( |
| 144 BetaChrome, |
| 145 CreateVisualElementsManifestTest, |
| 146 testing::Combine(testing::Values(install_static::BETA_INDEX), |
| 147 testing::Values(kExpectedBetaManifest))); |
| 148 INSTANTIATE_TEST_CASE_P( |
| 149 DevChrome, |
| 150 CreateVisualElementsManifestTest, |
| 151 testing::Combine(testing::Values(install_static::DEV_INDEX), |
| 152 testing::Values(kExpectedDevManifest))); |
| 153 INSTANTIATE_TEST_CASE_P( |
122 CanaryChrome, | 154 CanaryChrome, |
123 CreateVisualElementsManifestTest, | 155 CreateVisualElementsManifestTest, |
124 testing::Combine(testing::Values(install_static::CANARY_INDEX), | 156 testing::Combine(testing::Values(install_static::CANARY_INDEX), |
125 testing::Values(kExpectedCanaryManifest))); | 157 testing::Values(kExpectedCanaryManifest))); |
126 #else | 158 #else |
127 INSTANTIATE_TEST_CASE_P( | 159 INSTANTIATE_TEST_CASE_P( |
128 Chromium, | 160 Chromium, |
129 CreateVisualElementsManifestTest, | 161 CreateVisualElementsManifestTest, |
130 testing::Combine(testing::Values(install_static::CHROMIUM_INDEX), | 162 testing::Combine(testing::Values(install_static::CHROMIUM_INDEX), |
131 testing::Values(kExpectedPrimaryManifest))); | 163 testing::Values(kExpectedPrimaryManifest))); |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 installer::EscapeXmlAttributeValueInSingleQuotes(&val); | 550 installer::EscapeXmlAttributeValueInSingleQuotes(&val); |
519 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); | 551 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); |
520 } | 552 } |
521 | 553 |
522 TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) { | 554 TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) { |
523 base::string16 val(L"Google Chrome"); | 555 base::string16 val(L"Google Chrome"); |
524 static const wchar_t kExpectedEscapedVal[] = L"Google Chrome"; | 556 static const wchar_t kExpectedEscapedVal[] = L"Google Chrome"; |
525 installer::EscapeXmlAttributeValueInSingleQuotes(&val); | 557 installer::EscapeXmlAttributeValueInSingleQuotes(&val); |
526 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); | 558 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); |
527 } | 559 } |
OLD | NEW |