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

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

Powered by Google App Engine
This is Rietveld 408576698