| 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 <objbase.h> | 5 #include <objbase.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // Test that VisualElementsManifest.xml is created with the correct content when | 228 // Test that VisualElementsManifest.xml is created with the correct content when |
| 229 // VisualElements are present. | 229 // VisualElements are present. |
| 230 TEST_F(CreateVisualElementsManifestTest, VisualElementsManifestCreated) { | 230 TEST_F(CreateVisualElementsManifestTest, VisualElementsManifestCreated) { |
| 231 ASSERT_TRUE(file_util::CreateDirectory( | 231 ASSERT_TRUE(file_util::CreateDirectory( |
| 232 version_dir_.Append(installer::kVisualElements))); | 232 version_dir_.Append(installer::kVisualElements))); |
| 233 ASSERT_TRUE( | 233 ASSERT_TRUE( |
| 234 installer::CreateVisualElementsManifest(test_dir_.path(), version_)); | 234 installer::CreateVisualElementsManifest(test_dir_.path(), version_)); |
| 235 ASSERT_TRUE(base::PathExists(manifest_path_)); | 235 ASSERT_TRUE(base::PathExists(manifest_path_)); |
| 236 | 236 |
| 237 std::string read_manifest; | 237 std::string read_manifest; |
| 238 ASSERT_TRUE(file_util::ReadFileToString(manifest_path_, &read_manifest)); | 238 ASSERT_TRUE(base::ReadFileToString(manifest_path_, &read_manifest)); |
| 239 | 239 |
| 240 static const char kExpectedManifest[] = | 240 static const char kExpectedManifest[] = |
| 241 "<Application>\r\n" | 241 "<Application>\r\n" |
| 242 " <VisualElements\r\n" | 242 " <VisualElements\r\n" |
| 243 " DisplayName='Google Chrome'\r\n" | 243 " DisplayName='Google Chrome'\r\n" |
| 244 " Logo='0.0.0.0\\VisualElements\\Logo.png'\r\n" | 244 " Logo='0.0.0.0\\VisualElements\\Logo.png'\r\n" |
| 245 " SmallLogo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n" | 245 " SmallLogo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n" |
| 246 " ForegroundText='light'\r\n" | 246 " ForegroundText='light'\r\n" |
| 247 " BackgroundColor='white'>\r\n" | 247 " BackgroundColor='white'>\r\n" |
| 248 " <DefaultTile ShowName='allLogos'/>\r\n" | 248 " <DefaultTile ShowName='allLogos'/>\r\n" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 installer::EscapeXmlAttributeValueInSingleQuotes(&val); | 435 installer::EscapeXmlAttributeValueInSingleQuotes(&val); |
| 436 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); | 436 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); |
| 437 } | 437 } |
| 438 | 438 |
| 439 TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) { | 439 TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) { |
| 440 string16 val(L"Google Chrome"); | 440 string16 val(L"Google Chrome"); |
| 441 static const wchar_t kExpectedEscapedVal[] = L"Google Chrome"; | 441 static const wchar_t kExpectedEscapedVal[] = L"Google Chrome"; |
| 442 installer::EscapeXmlAttributeValueInSingleQuotes(&val); | 442 installer::EscapeXmlAttributeValueInSingleQuotes(&val); |
| 443 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); | 443 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); |
| 444 } | 444 } |
| OLD | NEW |