| OLD | NEW |
| 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 "base/win/shortcut.h" | 5 #include "base/win/shortcut.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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 link_properties_.set_dual_mode(false); | 45 link_properties_.set_dual_mode(false); |
| 46 } | 46 } |
| 47 | 47 |
| 48 // Shortcut 2's properties (all different from properties of shortcut 1). | 48 // Shortcut 2's properties (all different from properties of shortcut 1). |
| 49 { | 49 { |
| 50 const FilePath target_file_2(temp_dir_.path().Append(L"Target 2.txt")); | 50 const FilePath target_file_2(temp_dir_.path().Append(L"Target 2.txt")); |
| 51 file_util::WriteFile(target_file_2, kFileContents2, | 51 file_util::WriteFile(target_file_2, kFileContents2, |
| 52 arraysize(kFileContents2)); | 52 arraysize(kFileContents2)); |
| 53 | 53 |
| 54 FilePath icon_path_2; | 54 FilePath icon_path_2; |
| 55 file_util::CreateTemporaryFileInDir(temp_dir_.path(), &icon_path_2); | 55 base::CreateTemporaryFileInDir(temp_dir_.path(), &icon_path_2); |
| 56 | 56 |
| 57 link_properties_2_.set_target(target_file_2); | 57 link_properties_2_.set_target(target_file_2); |
| 58 link_properties_2_.set_working_dir(temp_dir_2_.path()); | 58 link_properties_2_.set_working_dir(temp_dir_2_.path()); |
| 59 link_properties_2_.set_arguments(L"--super --crazy"); | 59 link_properties_2_.set_arguments(L"--super --crazy"); |
| 60 link_properties_2_.set_description(L"The best in the west."); | 60 link_properties_2_.set_description(L"The best in the west."); |
| 61 link_properties_2_.set_icon(icon_path_2, 0); | 61 link_properties_2_.set_icon(icon_path_2, 0); |
| 62 link_properties_2_.set_app_id(L"Chrome.UserLevelCrazySuffix"); | 62 link_properties_2_.set_app_id(L"Chrome.UserLevelCrazySuffix"); |
| 63 link_properties_2_.set_dual_mode(true); | 63 link_properties_2_.set_dual_mode(true); |
| 64 } | 64 } |
| 65 } | 65 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 ASSERT_TRUE(CreateOrUpdateShortcutLink( | 264 ASSERT_TRUE(CreateOrUpdateShortcutLink( |
| 265 link_file_, link_properties_2_, SHORTCUT_REPLACE_EXISTING)); | 265 link_file_, link_properties_2_, SHORTCUT_REPLACE_EXISTING)); |
| 266 | 266 |
| 267 ShortcutProperties expected_properties(link_properties_2_); | 267 ShortcutProperties expected_properties(link_properties_2_); |
| 268 expected_properties.set_arguments(link_properties_.arguments); | 268 expected_properties.set_arguments(link_properties_.arguments); |
| 269 ValidateShortcut(link_file_, expected_properties); | 269 ValidateShortcut(link_file_, expected_properties); |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace win | 272 } // namespace win |
| 273 } // namespace base | 273 } // namespace base |
| OLD | NEW |