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

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

Issue 15255004: Refactor of BrowserDistribution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
« 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(dist_->GetAppShortCutName() + installer::kLnkExt); 120 string16 shortcut_name(
121 dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) +
122 installer::kLnkExt);
121 string16 alternate_shortcut_name( 123 string16 alternate_shortcut_name(
122 dist_->GetAlternateApplicationName() + installer::kLnkExt); 124 dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME_ALTERNATE) +
125 installer::kLnkExt);
123 126
124 user_desktop_shortcut_ = 127 user_desktop_shortcut_ =
125 fake_user_desktop_.path().Append(shortcut_name); 128 fake_user_desktop_.path().Append(shortcut_name);
126 user_quick_launch_shortcut_ = 129 user_quick_launch_shortcut_ =
127 fake_user_quick_launch_.path().Append(shortcut_name); 130 fake_user_quick_launch_.path().Append(shortcut_name);
128 user_start_menu_shortcut_ = 131 user_start_menu_shortcut_ =
129 fake_start_menu_.path().Append(dist_->GetAppShortCutName()) 132 fake_start_menu_.path().Append(
133 dist_->GetStartMenuShortcutSubfolder(
134 BrowserDistribution::SUBFOLDER_CHROME))
130 .Append(shortcut_name); 135 .Append(shortcut_name);
131 system_desktop_shortcut_ = 136 system_desktop_shortcut_ =
132 fake_common_desktop_.path().Append(shortcut_name); 137 fake_common_desktop_.path().Append(shortcut_name);
133 system_quick_launch_shortcut_ = 138 system_quick_launch_shortcut_ =
134 fake_default_user_quick_launch_.path().Append(shortcut_name); 139 fake_default_user_quick_launch_.path().Append(shortcut_name);
135 system_start_menu_shortcut_ = 140 system_start_menu_shortcut_ =
136 fake_common_start_menu_.path().Append(dist_->GetAppShortCutName()) 141 fake_common_start_menu_.path().Append(
142 dist_->GetStartMenuShortcutSubfolder(
143 BrowserDistribution::SUBFOLDER_CHROME))
137 .Append(shortcut_name); 144 .Append(shortcut_name);
138 user_alternate_desktop_shortcut_ = 145 user_alternate_desktop_shortcut_ =
139 fake_user_desktop_.path().Append(alternate_shortcut_name); 146 fake_user_desktop_.path().Append(alternate_shortcut_name);
140 } 147 }
141 148
142 virtual void TearDown() OVERRIDE { 149 virtual void TearDown() OVERRIDE {
143 // Try to unpin potentially pinned shortcuts (although pinning isn't tested, 150 // Try to unpin potentially pinned shortcuts (although pinning isn't tested,
144 // the call itself might still have pinned the Start Menu shortcuts). 151 // the call itself might still have pinned the Start Menu shortcuts).
145 base::win::TaskbarUnpinShortcutLink( 152 base::win::TaskbarUnpinShortcutLink(
146 user_start_menu_shortcut_.value().c_str()); 153 user_start_menu_shortcut_.value().c_str());
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 installer::EscapeXmlAttributeValueInSingleQuotes(&val); 435 installer::EscapeXmlAttributeValueInSingleQuotes(&val);
429 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); 436 ASSERT_STREQ(kExpectedEscapedVal, val.c_str());
430 } 437 }
431 438
432 TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) { 439 TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) {
433 string16 val(L"Google Chrome"); 440 string16 val(L"Google Chrome");
434 static const wchar_t kExpectedEscapedVal[] = L"Google Chrome"; 441 static const wchar_t kExpectedEscapedVal[] = L"Google Chrome";
435 installer::EscapeXmlAttributeValueInSingleQuotes(&val); 442 installer::EscapeXmlAttributeValueInSingleQuotes(&val);
436 ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); 443 ASSERT_STREQ(kExpectedEscapedVal, val.c_str());
437 } 444 }
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