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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 protected: | 69 protected: |
70 virtual void SetUp() OVERRIDE { | 70 virtual void SetUp() OVERRIDE { |
71 EXPECT_EQ(S_OK, CoInitialize(NULL)); | 71 EXPECT_EQ(S_OK, CoInitialize(NULL)); |
72 | 72 |
73 dist_ = BrowserDistribution::GetDistribution(); | 73 dist_ = BrowserDistribution::GetDistribution(); |
74 ASSERT_TRUE(dist_ != NULL); | 74 ASSERT_TRUE(dist_ != NULL); |
75 product_.reset(new installer::Product(dist_)); | 75 product_.reset(new installer::Product(dist_)); |
76 | 76 |
77 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 77 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
78 chrome_exe_ = temp_dir_.path().Append(installer::kChromeExe); | 78 chrome_exe_ = temp_dir_.path().Append(installer::kChromeExe); |
79 EXPECT_EQ(0, file_util::WriteFile(chrome_exe_, "", 0)); | 79 EXPECT_EQ(0, base::WriteFile(chrome_exe_, "", 0)); |
80 | 80 |
81 ShellUtil::ShortcutProperties chrome_properties(ShellUtil::CURRENT_USER); | 81 ShellUtil::ShortcutProperties chrome_properties(ShellUtil::CURRENT_USER); |
82 product_->AddDefaultShortcutProperties(chrome_exe_, &chrome_properties); | 82 product_->AddDefaultShortcutProperties(chrome_exe_, &chrome_properties); |
83 | 83 |
84 expected_properties_.set_target(chrome_exe_); | 84 expected_properties_.set_target(chrome_exe_); |
85 expected_properties_.set_icon(chrome_properties.icon, | 85 expected_properties_.set_icon(chrome_properties.icon, |
86 chrome_properties.icon_index); | 86 chrome_properties.icon_index); |
87 expected_properties_.set_app_id(chrome_properties.app_id); | 87 expected_properties_.set_app_id(chrome_properties.app_id); |
88 expected_properties_.set_description(chrome_properties.description); | 88 expected_properties_.set_description(chrome_properties.description); |
89 expected_properties_.set_dual_mode(false); | 89 expected_properties_.set_dual_mode(false); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 installer::EscapeXmlAttributeValueInSingleQuotes(&val); | 432 installer::EscapeXmlAttributeValueInSingleQuotes(&val); |
433 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); | 433 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); |
434 } | 434 } |
435 | 435 |
436 TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) { | 436 TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) { |
437 base::string16 val(L"Google Chrome"); | 437 base::string16 val(L"Google Chrome"); |
438 static const wchar_t kExpectedEscapedVal[] = L"Google Chrome"; | 438 static const wchar_t kExpectedEscapedVal[] = L"Google Chrome"; |
439 installer::EscapeXmlAttributeValueInSingleQuotes(&val); | 439 installer::EscapeXmlAttributeValueInSingleQuotes(&val); |
440 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); | 440 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); |
441 } | 441 } |
OLD | NEW |