| 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 | |
| 127 constexpr char kExpectedCanaryManifest[] = | 105 constexpr char kExpectedCanaryManifest[] = |
| 128 "<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n" | 106 "<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n" |
| 129 " <VisualElements\r\n" | 107 " <VisualElements\r\n" |
| 130 " ShowNameOnSquare150x150Logo='on'\r\n" | 108 " ShowNameOnSquare150x150Logo='on'\r\n" |
| 131 " Square150x150Logo='0.0.0.0\\VisualElements\\LogoCanary.png'\r\n" | 109 " Square150x150Logo='0.0.0.0\\VisualElements\\LogoCanary.png'\r\n" |
| 132 " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoCanary.png'\r\n" | 110 " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoCanary.png'\r\n" |
| 133 " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoCanary.png'\r\n" | 111 " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoCanary.png'\r\n" |
| 134 " ForegroundText='light'\r\n" | 112 " ForegroundText='light'\r\n" |
| 135 " BackgroundColor='#212121'/>\r\n" | 113 " BackgroundColor='#212121'/>\r\n" |
| 136 "</Application>\r\n"; | 114 "</Application>\r\n"; |
| 137 | 115 |
| 138 INSTANTIATE_TEST_CASE_P( | 116 INSTANTIATE_TEST_CASE_P( |
| 139 GoogleChrome, | 117 GoogleChrome, |
| 140 CreateVisualElementsManifestTest, | 118 CreateVisualElementsManifestTest, |
| 141 testing::Combine(testing::Values(install_static::STABLE_INDEX), | 119 testing::Combine(testing::Values(install_static::STABLE_INDEX), |
| 142 testing::Values(kExpectedPrimaryManifest))); | 120 testing::Values(kExpectedPrimaryManifest))); |
| 143 INSTANTIATE_TEST_CASE_P( | 121 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( | |
| 154 CanaryChrome, | 122 CanaryChrome, |
| 155 CreateVisualElementsManifestTest, | 123 CreateVisualElementsManifestTest, |
| 156 testing::Combine(testing::Values(install_static::CANARY_INDEX), | 124 testing::Combine(testing::Values(install_static::CANARY_INDEX), |
| 157 testing::Values(kExpectedCanaryManifest))); | 125 testing::Values(kExpectedCanaryManifest))); |
| 158 #else | 126 #else |
| 159 INSTANTIATE_TEST_CASE_P( | 127 INSTANTIATE_TEST_CASE_P( |
| 160 Chromium, | 128 Chromium, |
| 161 CreateVisualElementsManifestTest, | 129 CreateVisualElementsManifestTest, |
| 162 testing::Combine(testing::Values(install_static::CHROMIUM_INDEX), | 130 testing::Combine(testing::Values(install_static::CHROMIUM_INDEX), |
| 163 testing::Values(kExpectedPrimaryManifest))); | 131 testing::Values(kExpectedPrimaryManifest))); |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 installer::EscapeXmlAttributeValueInSingleQuotes(&val); | 518 installer::EscapeXmlAttributeValueInSingleQuotes(&val); |
| 551 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); | 519 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); |
| 552 } | 520 } |
| 553 | 521 |
| 554 TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) { | 522 TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) { |
| 555 base::string16 val(L"Google Chrome"); | 523 base::string16 val(L"Google Chrome"); |
| 556 static const wchar_t kExpectedEscapedVal[] = L"Google Chrome"; | 524 static const wchar_t kExpectedEscapedVal[] = L"Google Chrome"; |
| 557 installer::EscapeXmlAttributeValueInSingleQuotes(&val); | 525 installer::EscapeXmlAttributeValueInSingleQuotes(&val); |
| 558 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); | 526 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); |
| 559 } | 527 } |
| OLD | NEW |