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

Side by Side Diff: chrome/installer/util/shell_util_unittest.cc

Issue 1289333005: Change shortcut install location to non-subdir. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert part of cl/1438793002 that is no longer needed Created 5 years, 1 month 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/util/shell_util.cc ('k') | no next file » | 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 "chrome/installer/util/shell_util.h" 5 #include "chrome/installer/util/shell_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/base_paths_win.h" 10 #include "base/base_paths_win.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 const ShellUtil::ShortcutProperties& properties) { 110 const ShellUtil::ShortcutProperties& properties) {
111 base::FilePath expected_path; 111 base::FilePath expected_path;
112 switch (location) { 112 switch (location) {
113 case ShellUtil::SHORTCUT_LOCATION_DESKTOP: 113 case ShellUtil::SHORTCUT_LOCATION_DESKTOP:
114 expected_path = (properties.level == ShellUtil::CURRENT_USER) ? 114 expected_path = (properties.level == ShellUtil::CURRENT_USER) ?
115 fake_user_desktop_.path() : fake_common_desktop_.path(); 115 fake_user_desktop_.path() : fake_common_desktop_.path();
116 break; 116 break;
117 case ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH: 117 case ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH:
118 expected_path = fake_user_quick_launch_.path(); 118 expected_path = fake_user_quick_launch_.path();
119 break; 119 break;
120 case ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR: 120 case ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT:
121 expected_path = (properties.level == ShellUtil::CURRENT_USER) ?
122 fake_start_menu_.path() : fake_common_start_menu_.path();
123 break;
124 case ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED:
121 expected_path = (properties.level == ShellUtil::CURRENT_USER) ? 125 expected_path = (properties.level == ShellUtil::CURRENT_USER) ?
122 fake_start_menu_.path() : fake_common_start_menu_.path(); 126 fake_start_menu_.path() : fake_common_start_menu_.path();
123 expected_path = expected_path.Append( 127 expected_path = expected_path.Append(
124 dist_->GetStartMenuShortcutSubfolder( 128 dist_->GetStartMenuShortcutSubfolder(
125 BrowserDistribution::SUBFOLDER_CHROME)); 129 BrowserDistribution::SUBFOLDER_CHROME));
126 break; 130 break;
127 default: 131 default:
128 ADD_FAILURE() << "Unknown location"; 132 ADD_FAILURE() << "Unknown location";
129 return base::FilePath(); 133 return base::FilePath();
130 } 134 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 ShellUtil::SYSTEM_LEVEL, &path); 230 ShellUtil::SYSTEM_LEVEL, &path);
227 EXPECT_EQ(fake_common_desktop_.path(), path); 231 EXPECT_EQ(fake_common_desktop_.path(), path);
228 232
229 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist_, 233 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist_,
230 ShellUtil::CURRENT_USER, &path); 234 ShellUtil::CURRENT_USER, &path);
231 EXPECT_EQ(fake_user_quick_launch_.path(), path); 235 EXPECT_EQ(fake_user_quick_launch_.path(), path);
232 236
233 base::string16 start_menu_subfolder = 237 base::string16 start_menu_subfolder =
234 dist_->GetStartMenuShortcutSubfolder( 238 dist_->GetStartMenuShortcutSubfolder(
235 BrowserDistribution::SUBFOLDER_CHROME); 239 BrowserDistribution::SUBFOLDER_CHROME);
236 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, 240 ShellUtil::GetShortcutPath(
237 dist_, ShellUtil::CURRENT_USER, &path); 241 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
242 dist_, ShellUtil::CURRENT_USER, &path);
238 EXPECT_EQ(fake_start_menu_.path().Append(start_menu_subfolder), 243 EXPECT_EQ(fake_start_menu_.path().Append(start_menu_subfolder),
239 path); 244 path);
240 245
241 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, 246 ShellUtil::GetShortcutPath(
242 dist_, ShellUtil::SYSTEM_LEVEL, &path); 247 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
248 dist_, ShellUtil::SYSTEM_LEVEL, &path);
243 EXPECT_EQ(fake_common_start_menu_.path().Append(start_menu_subfolder), 249 EXPECT_EQ(fake_common_start_menu_.path().Append(start_menu_subfolder),
244 path); 250 path);
245 } 251 }
246 252
253 TEST_F(ShellUtilShortcutTest, MoveExistingShortcut) {
254 test_properties_.set_shortcut_name(L"Bobo le shortcut");
255 test_properties_.level = ShellUtil::SYSTEM_LEVEL;
256 base::FilePath old_shortcut_path(GetExpectedShortcutPath(
257 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
258 dist_, test_properties_));
259
260 ASSERT_TRUE(
261 ShellUtil::CreateOrUpdateShortcut(
262 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
263 dist_, test_properties_,
264 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
265 ValidateChromeShortcut(
266 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
267 dist_, test_properties_);
268 ASSERT_TRUE(base::PathExists(old_shortcut_path.DirName()));
269 ASSERT_TRUE(base::PathExists(old_shortcut_path));
270
271 ASSERT_TRUE(
272 ShellUtil::MoveExistingShortcut(
273 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
274 ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT,
275 dist_, test_properties_));
276
277 ValidateChromeShortcut(
278 ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT,
279 dist_, test_properties_);
280 ASSERT_FALSE(base::PathExists(old_shortcut_path));
281 ASSERT_FALSE(base::PathExists(old_shortcut_path.DirName()));
282 }
283
247 TEST_F(ShellUtilShortcutTest, CreateChromeExeShortcutWithDefaultProperties) { 284 TEST_F(ShellUtilShortcutTest, CreateChromeExeShortcutWithDefaultProperties) {
248 ShellUtil::ShortcutProperties properties(ShellUtil::CURRENT_USER); 285 ShellUtil::ShortcutProperties properties(ShellUtil::CURRENT_USER);
249 product_->AddDefaultShortcutProperties(chrome_exe_, &properties); 286 product_->AddDefaultShortcutProperties(chrome_exe_, &properties);
250 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 287 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
251 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, properties, 288 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, properties,
252 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); 289 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
253 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, 290 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
254 properties); 291 properties);
255 } 292 }
256 293
257 TEST_F(ShellUtilShortcutTest, CreateStartMenuShortcutWithAllProperties) { 294 TEST_F(ShellUtilShortcutTest, CreateStartMenuShortcutWithAllProperties) {
258 test_properties_.set_shortcut_name(L"Bobo le shortcut"); 295 test_properties_.set_shortcut_name(L"Bobo le shortcut");
259 test_properties_.level = ShellUtil::SYSTEM_LEVEL; 296 test_properties_.level = ShellUtil::SYSTEM_LEVEL;
260 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 297 ASSERT_TRUE(
261 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, 298 ShellUtil::CreateOrUpdateShortcut(
262 dist_, test_properties_, 299 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
263 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); 300 dist_, test_properties_,
264 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, 301 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
265 dist_, test_properties_); 302 ValidateChromeShortcut(
303 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
304 dist_, test_properties_);
266 } 305 }
267 306
268 TEST_F(ShellUtilShortcutTest, ReplaceSystemLevelDesktopShortcut) { 307 TEST_F(ShellUtilShortcutTest, ReplaceSystemLevelDesktopShortcut) {
269 test_properties_.level = ShellUtil::SYSTEM_LEVEL; 308 test_properties_.level = ShellUtil::SYSTEM_LEVEL;
270 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 309 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
271 ShellUtil::SHORTCUT_LOCATION_DESKTOP, 310 ShellUtil::SHORTCUT_LOCATION_DESKTOP,
272 dist_, test_properties_, 311 dist_, test_properties_,
273 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); 312 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
274 313
275 ShellUtil::ShortcutProperties new_properties(ShellUtil::SYSTEM_LEVEL); 314 ShellUtil::ShortcutProperties new_properties(ShellUtil::SYSTEM_LEVEL);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 ShellUtil::ShortcutProperties expected_properties(test_properties_); 349 ShellUtil::ShortcutProperties expected_properties(test_properties_);
311 expected_properties.set_arguments(updated_properties.arguments); 350 expected_properties.set_arguments(updated_properties.arguments);
312 351
313 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist_, 352 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist_,
314 expected_properties); 353 expected_properties);
315 } 354 }
316 355
317 TEST_F(ShellUtilShortcutTest, UpdateAddDualModeToStartMenuShortcut) { 356 TEST_F(ShellUtilShortcutTest, UpdateAddDualModeToStartMenuShortcut) {
318 ShellUtil::ShortcutProperties properties(ShellUtil::CURRENT_USER); 357 ShellUtil::ShortcutProperties properties(ShellUtil::CURRENT_USER);
319 product_->AddDefaultShortcutProperties(chrome_exe_, &properties); 358 product_->AddDefaultShortcutProperties(chrome_exe_, &properties);
320 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 359 ASSERT_TRUE(
321 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, dist_, 360 ShellUtil::CreateOrUpdateShortcut(
322 properties, ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); 361 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, dist_,
362 properties, ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
323 363
324 ShellUtil::ShortcutProperties added_properties(ShellUtil::CURRENT_USER); 364 ShellUtil::ShortcutProperties added_properties(ShellUtil::CURRENT_USER);
325 added_properties.set_dual_mode(true); 365 added_properties.set_dual_mode(true);
326 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 366 ASSERT_TRUE(
327 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, dist_, 367 ShellUtil::CreateOrUpdateShortcut(
328 added_properties, ShellUtil::SHELL_SHORTCUT_UPDATE_EXISTING)); 368 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, dist_,
369 added_properties, ShellUtil::SHELL_SHORTCUT_UPDATE_EXISTING));
329 370
330 ShellUtil::ShortcutProperties expected_properties(properties); 371 ShellUtil::ShortcutProperties expected_properties(properties);
331 expected_properties.set_dual_mode(true); 372 expected_properties.set_dual_mode(true);
332 373
333 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, 374 ValidateChromeShortcut(
334 dist_, expected_properties); 375 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
376 dist_, expected_properties);
335 } 377 }
336 378
337 TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevel) { 379 TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevel) {
338 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 380 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
339 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_, 381 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
340 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)); 382 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL));
341 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, 383 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
342 test_properties_); 384 test_properties_);
343 } 385 }
344 386
(...skipping 12 matching lines...) Expand all
357 test_properties_.level = ShellUtil::CURRENT_USER; 399 test_properties_.level = ShellUtil::CURRENT_USER;
358 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 400 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
359 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_, 401 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
360 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)); 402 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL));
361 ASSERT_FALSE(base::PathExists( 403 ASSERT_FALSE(base::PathExists(
362 fake_user_desktop_.path().Append(shortcut_name))); 404 fake_user_desktop_.path().Append(shortcut_name)));
363 } 405 }
364 406
365 TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevelStartMenu) { 407 TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevelStartMenu) {
366 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 408 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
367 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, 409 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
368 dist_, test_properties_, 410 dist_, test_properties_,
369 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)); 411 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL));
370 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, 412 ValidateChromeShortcut(
371 dist_, test_properties_); 413 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
414 dist_, test_properties_);
372 } 415 }
373 416
374 TEST_F(ShellUtilShortcutTest, CreateAlwaysUserWithSystemLevelPresent) { 417 TEST_F(ShellUtilShortcutTest, CreateAlwaysUserWithSystemLevelPresent) {
375 base::string16 shortcut_name( 418 base::string16 shortcut_name(
376 dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) + 419 dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) +
377 installer::kLnkExt); 420 installer::kLnkExt);
378 421
379 test_properties_.level = ShellUtil::SYSTEM_LEVEL; 422 test_properties_.level = ShellUtil::SYSTEM_LEVEL;
380 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 423 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
381 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_, 424 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_,
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 expected_properties3.set_arguments(base::string16()); 736 expected_properties3.set_arguments(base::string16());
694 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, 737 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
695 expected_properties3); 738 expected_properties3);
696 expected_properties4.set_arguments(L"--show-app-list"); 739 expected_properties4.set_arguments(L"--show-app-list");
697 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, 740 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_,
698 expected_properties4); 741 expected_properties4);
699 } 742 }
700 743
701 TEST_F(ShellUtilShortcutTest, CreateMultipleStartMenuShortcutsAndRemoveFolder) { 744 TEST_F(ShellUtilShortcutTest, CreateMultipleStartMenuShortcutsAndRemoveFolder) {
702 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 745 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
703 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, 746 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
704 dist_, test_properties_, 747 dist_, test_properties_,
705 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); 748 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
706 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 749 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
707 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR, 750 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR,
708 dist_, test_properties_, 751 dist_, test_properties_,
709 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); 752 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
710 test_properties_.set_shortcut_name(L"A second shortcut"); 753 test_properties_.set_shortcut_name(L"A second shortcut");
711 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 754 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
712 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, 755 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
713 dist_, test_properties_, 756 dist_, test_properties_,
714 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); 757 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
715 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( 758 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut(
716 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR, 759 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR,
717 dist_, test_properties_, 760 dist_, test_properties_,
718 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); 761 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS));
719 762
720 base::FilePath chrome_shortcut_folder( 763 base::FilePath chrome_shortcut_folder(
721 fake_start_menu_.path().Append( 764 fake_start_menu_.path().Append(
722 dist_->GetStartMenuShortcutSubfolder( 765 dist_->GetStartMenuShortcutSubfolder(
(...skipping 13 matching lines...) Expand all
736 base::FileEnumerator chrome_apps_file_counter(chrome_apps_shortcut_folder, 779 base::FileEnumerator chrome_apps_file_counter(chrome_apps_shortcut_folder,
737 false, 780 false,
738 base::FileEnumerator::FILES); 781 base::FileEnumerator::FILES);
739 count = 0; 782 count = 0;
740 while (!chrome_apps_file_counter.Next().empty()) 783 while (!chrome_apps_file_counter.Next().empty())
741 ++count; 784 ++count;
742 EXPECT_EQ(2, count); 785 EXPECT_EQ(2, count);
743 786
744 ASSERT_TRUE(base::PathExists(chrome_shortcut_folder)); 787 ASSERT_TRUE(base::PathExists(chrome_shortcut_folder));
745 ASSERT_TRUE(ShellUtil::RemoveShortcuts( 788 ASSERT_TRUE(ShellUtil::RemoveShortcuts(
746 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, dist_, 789 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, dist_,
747 ShellUtil::CURRENT_USER, chrome_exe_)); 790 ShellUtil::CURRENT_USER, chrome_exe_));
748 ASSERT_FALSE(base::PathExists(chrome_shortcut_folder)); 791 ASSERT_FALSE(base::PathExists(chrome_shortcut_folder));
749 792
750 ASSERT_TRUE(base::PathExists(chrome_apps_shortcut_folder)); 793 ASSERT_TRUE(base::PathExists(chrome_apps_shortcut_folder));
751 ASSERT_TRUE(ShellUtil::RemoveShortcuts( 794 ASSERT_TRUE(ShellUtil::RemoveShortcuts(
752 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR, dist_, 795 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR, dist_,
753 ShellUtil::CURRENT_USER, chrome_exe_)); 796 ShellUtil::CURRENT_USER, chrome_exe_));
754 ASSERT_FALSE(base::PathExists(chrome_apps_shortcut_folder)); 797 ASSERT_FALSE(base::PathExists(chrome_apps_shortcut_folder));
755 } 798 }
756 799
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 1046
1004 const base::string16 expected[] = { L"", L"MY", L"MZXQ", L"MZXW6", L"MZXW6YQ", 1047 const base::string16 expected[] = { L"", L"MY", L"MZXQ", L"MZXW6", L"MZXW6YQ",
1005 L"MZXW6YTB", L"MZXW6YTBOI"}; 1048 L"MZXW6YTB", L"MZXW6YTBOI"};
1006 1049
1007 // Run the tests, with one more letter in the input every pass. 1050 // Run the tests, with one more letter in the input every pass.
1008 for (int i = 0; i < arraysize(expected); ++i) { 1051 for (int i = 0; i < arraysize(expected); ++i) {
1009 ASSERT_EQ(expected[i], 1052 ASSERT_EQ(expected[i],
1010 ShellUtil::ByteArrayToBase32(test_array, i)); 1053 ShellUtil::ByteArrayToBase32(test_array, i));
1011 } 1054 }
1012 } 1055 }
OLDNEW
« no previous file with comments | « chrome/installer/util/shell_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698