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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Shortcut 2's properties (all different from properties of shortcut 1). | 51 // Shortcut 2's properties (all different from properties of shortcut 1). |
52 { | 52 { |
53 const FilePath target_file_2(temp_dir_.GetPath().Append(L"Target 2.txt")); | 53 const FilePath target_file_2(temp_dir_.GetPath().Append(L"Target 2.txt")); |
54 WriteFile(target_file_2, kFileContents2, arraysize(kFileContents2)); | 54 WriteFile(target_file_2, kFileContents2, arraysize(kFileContents2)); |
55 | 55 |
56 FilePath icon_path_2; | 56 FilePath icon_path_2; |
57 CreateTemporaryFileInDir(temp_dir_.GetPath(), &icon_path_2); | 57 CreateTemporaryFileInDir(temp_dir_.GetPath(), &icon_path_2); |
58 | 58 |
59 link_properties_2_.set_target(target_file_2); | 59 link_properties_2_.set_target(target_file_2); |
60 link_properties_2_.set_working_dir(temp_dir_2_.path()); | 60 link_properties_2_.set_working_dir(temp_dir_2_.GetPath()); |
61 link_properties_2_.set_arguments(L"--super --crazy"); | 61 link_properties_2_.set_arguments(L"--super --crazy"); |
62 link_properties_2_.set_description(L"The best in the west."); | 62 link_properties_2_.set_description(L"The best in the west."); |
63 link_properties_2_.set_icon(icon_path_2, 0); | 63 link_properties_2_.set_icon(icon_path_2, 0); |
64 link_properties_2_.set_app_id(L"Chrome.UserLevelCrazySuffix"); | 64 link_properties_2_.set_app_id(L"Chrome.UserLevelCrazySuffix"); |
65 link_properties_2_.set_dual_mode(true); | 65 link_properties_2_.set_dual_mode(true); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 ScopedCOMInitializer com_initializer_; | 69 ScopedCOMInitializer com_initializer_; |
70 ScopedTempDir temp_dir_; | 70 ScopedTempDir temp_dir_; |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 ASSERT_TRUE(CreateOrUpdateShortcutLink( | 316 ASSERT_TRUE(CreateOrUpdateShortcutLink( |
317 link_file_, link_properties_2_, SHORTCUT_REPLACE_EXISTING)); | 317 link_file_, link_properties_2_, SHORTCUT_REPLACE_EXISTING)); |
318 | 318 |
319 ShortcutProperties expected_properties(link_properties_2_); | 319 ShortcutProperties expected_properties(link_properties_2_); |
320 expected_properties.set_arguments(link_properties_.arguments); | 320 expected_properties.set_arguments(link_properties_.arguments); |
321 ValidateShortcut(link_file_, expected_properties); | 321 ValidateShortcut(link_file_, expected_properties); |
322 } | 322 } |
323 | 323 |
324 } // namespace win | 324 } // namespace win |
325 } // namespace base | 325 } // namespace base |
OLD | NEW |