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

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

Issue 94013004: Add base:: to string16s in chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: try again Created 7 years 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/install_worker.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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 default_user_quick_launch_override_.reset( 110 default_user_quick_launch_override_.reset(
111 new base::ScopedPathOverride(base::DIR_DEFAULT_USER_QUICK_LAUNCH, 111 new base::ScopedPathOverride(base::DIR_DEFAULT_USER_QUICK_LAUNCH,
112 fake_default_user_quick_launch_.path())); 112 fake_default_user_quick_launch_.path()));
113 start_menu_override_.reset( 113 start_menu_override_.reset(
114 new base::ScopedPathOverride(base::DIR_START_MENU, 114 new base::ScopedPathOverride(base::DIR_START_MENU,
115 fake_start_menu_.path())); 115 fake_start_menu_.path()));
116 common_start_menu_override_.reset( 116 common_start_menu_override_.reset(
117 new base::ScopedPathOverride(base::DIR_COMMON_START_MENU, 117 new base::ScopedPathOverride(base::DIR_COMMON_START_MENU,
118 fake_common_start_menu_.path())); 118 fake_common_start_menu_.path()));
119 119
120 string16 shortcut_name( 120 base::string16 shortcut_name(
121 dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) + 121 dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) +
122 installer::kLnkExt); 122 installer::kLnkExt);
123 string16 alternate_shortcut_name( 123 base::string16 alternate_shortcut_name(
124 dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME_ALTERNATE) + 124 dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME_ALTERNATE) +
125 installer::kLnkExt); 125 installer::kLnkExt);
126 126
127 user_desktop_shortcut_ = 127 user_desktop_shortcut_ =
128 fake_user_desktop_.path().Append(shortcut_name); 128 fake_user_desktop_.path().Append(shortcut_name);
129 user_quick_launch_shortcut_ = 129 user_quick_launch_shortcut_ =
130 fake_user_quick_launch_.path().Append(shortcut_name); 130 fake_user_quick_launch_.path().Append(shortcut_name);
131 user_start_menu_shortcut_ = 131 user_start_menu_shortcut_ =
132 fake_start_menu_.path().Append( 132 fake_start_menu_.path().Append(
133 dist_->GetStartMenuShortcutSubfolder( 133 dist_->GetStartMenuShortcutSubfolder(
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 chrome_exe_, *product_, *prefs_, installer::CURRENT_USER, 419 chrome_exe_, *product_, *prefs_, installer::CURRENT_USER,
420 installer::INSTALL_SHORTCUT_CREATE_EACH_IF_NO_SYSTEM_LEVEL); 420 installer::INSTALL_SHORTCUT_CREATE_EACH_IF_NO_SYSTEM_LEVEL);
421 ASSERT_FALSE(base::PathExists(user_desktop_shortcut_)); 421 ASSERT_FALSE(base::PathExists(user_desktop_shortcut_));
422 base::win::ValidateShortcut(user_quick_launch_shortcut_, 422 base::win::ValidateShortcut(user_quick_launch_shortcut_,
423 expected_properties_); 423 expected_properties_);
424 base::win::ValidateShortcut(user_start_menu_shortcut_, 424 base::win::ValidateShortcut(user_start_menu_shortcut_,
425 expected_start_menu_properties_); 425 expected_start_menu_properties_);
426 } 426 }
427 427
428 TEST(EscapeXmlAttributeValueTest, EscapeCrazyValue) { 428 TEST(EscapeXmlAttributeValueTest, EscapeCrazyValue) {
429 string16 val(L"This has 'crazy' \"chars\" && < and > signs."); 429 base::string16 val(L"This has 'crazy' \"chars\" && < and > signs.");
430 static const wchar_t kExpectedEscapedVal[] = 430 static const wchar_t kExpectedEscapedVal[] =
431 L"This has &apos;crazy&apos; \"chars\" &amp;&amp; &lt; and > signs."; 431 L"This has &apos;crazy&apos; \"chars\" &amp;&amp; &lt; and > signs.";
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 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/install_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698