summaryrefslogtreecommitdiff
path: root/chrome/installer
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2013-08-14 11:51:42 +0100
committerBen Murdoch <benm@google.com>2013-08-14 11:51:42 +0100
commitc2db58bd994c04d98e4ee2cd7565b71548655fe3 (patch)
treeb37b6fa44ddba0dbeffd3ec22334f6fa0e57751b /chrome/installer
parentfc9d5208680b35b576f64623b0e38c14bc0e97dd (diff)
downloadchromium_org-c2db58bd994c04d98e4ee2cd7565b71548655fe3.tar.gz
Merge from Chromium at DEPS revision r217147
This commit was generated by merge_to_master.py. Change-Id: Ifa927da4997e49ab95edfc5def5ee5615a76b1be
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/util/shell_util.cc83
-rw-r--r--chrome/installer/util/shell_util_unittest.cc122
2 files changed, 120 insertions, 85 deletions
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 36f0f77dbe..57521e814d 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -1186,10 +1186,48 @@ bool GetAppShortcutsFolder(BrowserDistribution* dist,
return true;
}
-typedef base::Callback<bool(const base::FilePath&)> FileOperationCallback;
+// Shortcut filters for BatchShortcutAction().
+
+typedef base::Callback<bool(const base::FilePath& /*shortcut_path*/,
+ const string16& /*args*/)>
+ ShortcutFilterCallback;
+
+// FilterTargetEq is a shortcut filter that matches only shortcuts that have a
+// specific target.
+class FilterTargetEq {
+ public:
+ explicit FilterTargetEq(const base::FilePath& desired_target_exe);
+
+ // Returns true if filter rules are satisfied, i.e.:
+ // - |target_path| matches |desired_target_compare_|.
+ bool Match(const base::FilePath& target_path, const string16& args) const;
+
+ // A convenience routine to create a callback to call Match().
+ // The callback is only valid during the lifetime of the FilterTargetEq
+ // instance.
+ ShortcutFilterCallback AsShortcutFilterCallback();
+
+ private:
+ InstallUtil::ProgramCompare desired_target_compare_;
+};
+
+FilterTargetEq::FilterTargetEq(const base::FilePath& desired_target_exe)
+ : desired_target_compare_(desired_target_exe) {}
+
+bool FilterTargetEq::Match(const base::FilePath& target_path,
+ const string16& args) const {
+ return desired_target_compare_.EvaluatePath(target_path);
+}
+
+ShortcutFilterCallback FilterTargetEq::AsShortcutFilterCallback() {
+ return base::Bind(&FilterTargetEq::Match, base::Unretained(this));
+}
// Shortcut operations for BatchShortcutAction().
+typedef base::Callback<bool(const base::FilePath& /*shortcut_path*/)>
+ ShortcutOperationCallback;
+
bool ShortcutOpUnpin(const base::FilePath& shortcut_path) {
VLOG(1) << "Trying to unpin " << shortcut_path.value();
if (!base::win::TaskbarUnpinShortcutLink(shortcut_path.value().c_str())) {
@@ -1214,15 +1252,14 @@ bool ShortcutOpUpdate(const base::win::ShortcutProperties& shortcut_properties,
}
// {|location|, |dist|, |level|} determine |shortcut_folder|.
-// Applies |shortcut_operation| to each shortcut in |shortcut_folder| that
-// targets |target_exe|.
-// Returns true if all operations are successful. All intended operations are
-// attempted even if failures occur.
-bool BatchShortcutAction(const FileOperationCallback& shortcut_operation,
+// For each shortcut in |shortcut_folder| that match |shortcut_filter|, apply
+// |shortcut_operation|. Returns true if all operations are successful.
+// All intended operations are attempted, even if failures occur.
+bool BatchShortcutAction(const ShortcutFilterCallback& shortcut_filter,
+ const ShortcutOperationCallback& shortcut_operation,
ShellUtil::ShortcutLocation location,
BrowserDistribution* dist,
- ShellUtil::ShellChange level,
- const base::FilePath& target_exe) {
+ ShellUtil::ShellChange level) {
DCHECK(!shortcut_operation.is_null());
base::FilePath shortcut_folder;
if (!ShellUtil::GetShortcutPath(location, dist, level, &shortcut_folder)) {
@@ -1231,16 +1268,16 @@ bool BatchShortcutAction(const FileOperationCallback& shortcut_operation,
}
bool success = true;
- InstallUtil::ProgramCompare target_compare(target_exe);
base::FileEnumerator enumerator(
shortcut_folder, false, base::FileEnumerator::FILES,
string16(L"*") + installer::kLnkExt);
base::FilePath target_path;
+ string16 args;
for (base::FilePath shortcut_path = enumerator.Next();
!shortcut_path.empty();
shortcut_path = enumerator.Next()) {
- if (base::win::ResolveShortcut(shortcut_path, &target_path, NULL)) {
- if (target_compare.EvaluatePath(target_path) &&
+ if (base::win::ResolveShortcut(shortcut_path, &target_path, &args)) {
+ if (shortcut_filter.Run(target_path, args) &&
!shortcut_operation.Run(shortcut_path)) {
success = false;
}
@@ -1996,12 +2033,20 @@ bool ShellUtil::RemoveShortcuts(ShellUtil::ShortcutLocation location,
return RemoveShortcutFolder(location, dist, level);
case SHORTCUT_LOCATION_TASKBAR_PINS:
- return BatchShortcutAction(base::Bind(&ShortcutOpUnpin), location, dist,
- level, target_exe);
+ return BatchShortcutAction(FilterTargetEq(target_exe).
+ AsShortcutFilterCallback(),
+ base::Bind(&ShortcutOpUnpin),
+ location,
+ dist,
+ level);
default:
- return BatchShortcutAction(base::Bind(&ShortcutOpDelete), location, dist,
- level, target_exe);
+ return BatchShortcutAction(FilterTargetEq(target_exe).
+ AsShortcutFilterCallback(),
+ base::Bind(&ShortcutOpDelete),
+ location,
+ dist,
+ level);
}
}
@@ -2017,8 +2062,12 @@ bool ShellUtil::UpdateShortcuts(
base::win::ShortcutProperties shortcut_properties(
TranslateShortcutProperties(properties));
- return BatchShortcutAction(base::Bind(&ShortcutOpUpdate, shortcut_properties),
- location, dist, level, target_exe);
+ return BatchShortcutAction(FilterTargetEq(target_exe).
+ AsShortcutFilterCallback(),
+ base::Bind(&ShortcutOpUpdate, shortcut_properties),
+ location,
+ dist,
+ level);
}
bool ShellUtil::GetUserSpecificRegistrySuffix(string16* suffix) {
diff --git a/chrome/installer/util/shell_util_unittest.cc b/chrome/installer/util/shell_util_unittest.cc
index b2e31feec1..647ec28ba0 100644
--- a/chrome/installer/util/shell_util_unittest.cc
+++ b/chrome/installer/util/shell_util_unittest.cc
@@ -33,6 +33,8 @@ const wchar_t kManganeseExe[] = L"manganese.exe";
// from product_->AddDefaultShortcutProperties().
class ShellUtilShortcutTest : public testing::Test {
protected:
+ ShellUtilShortcutTest() : test_properties_(ShellUtil::CURRENT_USER) {}
+
virtual void SetUp() OVERRIDE {
dist_ = BrowserDistribution::GetDistribution();
ASSERT_TRUE(dist_ != NULL);
@@ -72,14 +74,12 @@ class ShellUtilShortcutTest : public testing::Test {
base::FilePath icon_path;
file_util::CreateTemporaryFileInDir(temp_dir_.path(), &icon_path);
- test_properties_.reset(
- new ShellUtil::ShortcutProperties(ShellUtil::CURRENT_USER));
- test_properties_->set_target(chrome_exe_);
- test_properties_->set_arguments(L"--test --chrome");
- test_properties_->set_description(L"Makes polar bears dance.");
- test_properties_->set_icon(icon_path, 0);
- test_properties_->set_app_id(L"Polar.Bear");
- test_properties_->set_dual_mode(true);
+ test_properties_.set_target(chrome_exe_);
+ test_properties_.set_arguments(L"--test --chrome");
+ test_properties_.set_description(L"Makes polar bears dance.");
+ test_properties_.set_icon(icon_path, 0);
+ test_properties_.set_app_id(L"Polar.Bear");
+ test_properties_.set_dual_mode(true);
}
// Validates that the shortcut at |location| matches |properties| (and
@@ -164,7 +164,7 @@ class ShellUtilShortcutTest : public testing::Test {
scoped_ptr<installer::Product> product_;
// A ShellUtil::ShortcutProperties object with common properties set already.
- scoped_ptr<ShellUtil::ShortcutProperties> test_properties_;
+ ShellUtil::ShortcutProperties test_properties_;
base::ScopedTempDir temp_dir_;
base::ScopedTempDir fake_user_desktop_;
@@ -220,21 +220,21 @@ TEST_F(ShellUtilShortcutTest, CreateChromeExeShortcutWithDefaultProperties) {
}
TEST_F(ShellUtilShortcutTest, CreateStartMenuShortcutWithAllProperties) {
- test_properties_->set_shortcut_name(L"Bobo le shortcut");
- test_properties_->level = ShellUtil::SYSTEM_LEVEL;
+ test_properties_.set_shortcut_name(L"Bobo le shortcut");
+ test_properties_.level = ShellUtil::SYSTEM_LEVEL;
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
ShellUtil::SHORTCUT_LOCATION_START_MENU,
- dist_, *test_properties_,
+ dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_START_MENU, dist_,
- *test_properties_);
+ test_properties_);
}
TEST_F(ShellUtilShortcutTest, ReplaceSystemLevelQuickLaunchShortcut) {
- test_properties_->level = ShellUtil::SYSTEM_LEVEL;
+ test_properties_.level = ShellUtil::SYSTEM_LEVEL;
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH,
- dist_, *test_properties_,
+ dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
ShellUtil::ShortcutProperties new_properties(ShellUtil::SYSTEM_LEVEL);
@@ -259,7 +259,7 @@ TEST_F(ShellUtilShortcutTest, ReplaceSystemLevelQuickLaunchShortcut) {
TEST_F(ShellUtilShortcutTest, UpdateQuickLaunchShortcutArguments) {
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH,
- dist_, *test_properties_,
+ dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
// Only changing one property, don't need all the defaults.
@@ -272,7 +272,7 @@ TEST_F(ShellUtilShortcutTest, UpdateQuickLaunchShortcutArguments) {
// Expect the properties set in |updated_properties| to be set as above and
// all other properties to remain unchanged.
- ShellUtil::ShortcutProperties expected_properties(*test_properties_);
+ ShellUtil::ShortcutProperties expected_properties(test_properties_);
expected_properties.set_arguments(updated_properties.arguments);
ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist_,
@@ -301,28 +301,25 @@ TEST_F(ShellUtilShortcutTest, UpdateAddDualModeToStartMenuShortcut) {
TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevel) {
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL));
ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_);
+ test_properties_);
}
TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevelWithSystemLevelPresent) {
string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt);
- test_properties_->level = ShellUtil::SYSTEM_LEVEL;
+ test_properties_.level = ShellUtil::SYSTEM_LEVEL;
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
ASSERT_TRUE(base::PathExists(
fake_common_desktop_.path().Append(shortcut_name)));
- test_properties_->level = ShellUtil::CURRENT_USER;
+ test_properties_.level = ShellUtil::CURRENT_USER;
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL));
ASSERT_FALSE(base::PathExists(
fake_user_desktop_.path().Append(shortcut_name)));
@@ -331,27 +328,25 @@ TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevelWithSystemLevelPresent) {
TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevelStartMenu) {
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
ShellUtil::SHORTCUT_LOCATION_START_MENU,
- dist_, *test_properties_,
+ dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL));
ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_START_MENU, dist_,
- *test_properties_);
+ test_properties_);
}
TEST_F(ShellUtilShortcutTest, CreateAlwaysUserWithSystemLevelPresent) {
string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt);
- test_properties_->level = ShellUtil::SYSTEM_LEVEL;
+ test_properties_.level = ShellUtil::SYSTEM_LEVEL;
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
ASSERT_TRUE(base::PathExists(
fake_common_desktop_.path().Append(shortcut_name)));
- test_properties_->level = ShellUtil::CURRENT_USER;
+ test_properties_.level = ShellUtil::CURRENT_USER;
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
ASSERT_TRUE(base::PathExists(
fake_user_desktop_.path().Append(shortcut_name)));
@@ -359,8 +354,7 @@ TEST_F(ShellUtilShortcutTest, CreateAlwaysUserWithSystemLevelPresent) {
TEST_F(ShellUtilShortcutTest, RemoveChromeShortcut) {
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt);
@@ -375,10 +369,9 @@ TEST_F(ShellUtilShortcutTest, RemoveChromeShortcut) {
}
TEST_F(ShellUtilShortcutTest, RemoveSystemLevelChromeShortcut) {
- test_properties_->level = ShellUtil::SYSTEM_LEVEL;
+ test_properties_.level = ShellUtil::SYSTEM_LEVEL;
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt);
@@ -397,10 +390,9 @@ TEST_F(ShellUtilShortcutTest, RemoveMultipleChromeShortcuts) {
const wchar_t kShortcutName1[] = L"Chrome 1";
const wchar_t kShortcutName2[] = L"Chrome 2";
- test_properties_->set_shortcut_name(kShortcutName1);
+ test_properties_.set_shortcut_name(kShortcutName1);
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
string16 shortcut1_name(
string16(kShortcutName1).append(installer::kLnkExt));
@@ -408,11 +400,10 @@ TEST_F(ShellUtilShortcutTest, RemoveMultipleChromeShortcuts) {
fake_user_desktop_.path().Append(shortcut1_name));
ASSERT_TRUE(base::PathExists(shortcut1_path));
- test_properties_->set_shortcut_name(kShortcutName2);
- test_properties_->set_arguments(L"--profile-directory=\"Profile 2\"");
+ test_properties_.set_shortcut_name(kShortcutName2);
+ test_properties_.set_arguments(L"--profile-directory=\"Profile 2\"");
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
string16 shortcut2_name(string16(kShortcutName2).append(installer::kLnkExt));
base::FilePath shortcut2_path(
@@ -429,8 +420,7 @@ TEST_F(ShellUtilShortcutTest, RemoveMultipleChromeShortcuts) {
TEST_F(ShellUtilShortcutTest, UpdateChromeShortcut) {
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt);
@@ -445,17 +435,16 @@ TEST_F(ShellUtilShortcutTest, UpdateChromeShortcut) {
ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, ShellUtil::CURRENT_USER,
chrome_exe_, updated_properties));
- ShellUtil::ShortcutProperties expected_properties(*test_properties_);
+ ShellUtil::ShortcutProperties expected_properties(test_properties_);
expected_properties.set_target(new_exe);
ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
expected_properties);
}
TEST_F(ShellUtilShortcutTest, UpdateSystemLevelChromeShortcut) {
- test_properties_->level = ShellUtil::SYSTEM_LEVEL;
+ test_properties_.level = ShellUtil::SYSTEM_LEVEL;
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt);
@@ -471,7 +460,7 @@ TEST_F(ShellUtilShortcutTest, UpdateSystemLevelChromeShortcut) {
ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, ShellUtil::SYSTEM_LEVEL,
chrome_exe_, updated_properties));
- ShellUtil::ShortcutProperties expected_properties(*test_properties_);
+ ShellUtil::ShortcutProperties expected_properties(test_properties_);
expected_properties.set_target(new_exe);
ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
expected_properties);
@@ -482,30 +471,28 @@ TEST_F(ShellUtilShortcutTest, UpdateMultipleChromeShortcuts) {
const wchar_t kShortcutName2[] = L"Chrome 2";
// Setup shortcut 1.
- test_properties_->set_shortcut_name(kShortcutName1);
+ test_properties_.set_shortcut_name(kShortcutName1);
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
string16 shortcut1_name(
string16(kShortcutName1).append(installer::kLnkExt));
base::FilePath shortcut1_path(
fake_user_desktop_.path().Append(shortcut1_name));
- ShellUtil::ShortcutProperties expected_properties1(*test_properties_);
+ ShellUtil::ShortcutProperties expected_properties1(test_properties_);
// Setup shortcut 2, which also has arguments.
string16 shortcut2_args = L"--profile-directory=\"Profile 2\"";
- test_properties_->set_shortcut_name(kShortcutName2);
- test_properties_->set_arguments(shortcut2_args);
+ test_properties_.set_shortcut_name(kShortcutName2);
+ test_properties_.set_arguments(shortcut2_args);
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
string16 shortcut2_name(string16(kShortcutName2).append(installer::kLnkExt));
base::FilePath shortcut2_path(
fake_user_desktop_.path().Append(shortcut2_name));
ASSERT_TRUE(base::PathExists(shortcut2_path));
- ShellUtil::ShortcutProperties expected_properties2(*test_properties_);
+ ShellUtil::ShortcutProperties expected_properties2(test_properties_);
// Update shortcuts: target "manganese.exe" instead of "chrome.exe".
base::FilePath new_exe = temp_dir_.path().Append(kManganeseExe);
@@ -529,12 +516,12 @@ TEST_F(ShellUtilShortcutTest, UpdateMultipleChromeShortcuts) {
TEST_F(ShellUtilShortcutTest, CreateMultipleStartMenuShortcutsAndRemoveFolder) {
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
ShellUtil::SHORTCUT_LOCATION_START_MENU,
- dist_, *test_properties_,
+ dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
- test_properties_->set_shortcut_name(L"A second shortcut");
+ test_properties_.set_shortcut_name(L"A second shortcut");
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
ShellUtil::SHORTCUT_LOCATION_START_MENU,
- dist_, *test_properties_,
+ dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
base::FilePath shortcut_folder(
@@ -560,10 +547,9 @@ TEST_F(ShellUtilShortcutTest, DontRemoveChromeShortcutIfPointsToAnotherChrome) {
other_exe_dir.path().Append(installer::kChromeExe);
EXPECT_EQ(0, file_util::WriteFile(other_chrome_exe, "", 0));
- test_properties_->set_target(other_chrome_exe);
+ test_properties_.set_target(other_chrome_exe);
ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
- ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
- *test_properties_,
+ ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt);