Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: chrome/installer/setup/install_unittest.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698