| 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 "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 Loading... |
| 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_CHROME_DIR_DEPRECATED: |
| 121 expected_path = (properties.level == ShellUtil::CURRENT_USER) ? | 121 expected_path = (properties.level == ShellUtil::CURRENT_USER) ? |
| 122 fake_start_menu_.path() : fake_common_start_menu_.path(); | 122 fake_start_menu_.path() : fake_common_start_menu_.path(); |
| 123 expected_path = expected_path.Append( | 123 expected_path = expected_path.Append( |
| 124 dist_->GetStartMenuShortcutSubfolder( | 124 dist_->GetStartMenuShortcutSubfolder( |
| 125 BrowserDistribution::SUBFOLDER_CHROME)); | 125 BrowserDistribution::SUBFOLDER_CHROME)); |
| 126 break; | 126 break; |
| 127 default: | 127 default: |
| 128 ADD_FAILURE() << "Unknown location"; | 128 ADD_FAILURE() << "Unknown location"; |
| 129 return base::FilePath(); | 129 return base::FilePath(); |
| 130 } | 130 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 ShellUtil::SYSTEM_LEVEL, &path); | 226 ShellUtil::SYSTEM_LEVEL, &path); |
| 227 EXPECT_EQ(fake_common_desktop_.path(), path); | 227 EXPECT_EQ(fake_common_desktop_.path(), path); |
| 228 | 228 |
| 229 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist_, | 229 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist_, |
| 230 ShellUtil::CURRENT_USER, &path); | 230 ShellUtil::CURRENT_USER, &path); |
| 231 EXPECT_EQ(fake_user_quick_launch_.path(), path); | 231 EXPECT_EQ(fake_user_quick_launch_.path(), path); |
| 232 | 232 |
| 233 base::string16 start_menu_subfolder = | 233 base::string16 start_menu_subfolder = |
| 234 dist_->GetStartMenuShortcutSubfolder( | 234 dist_->GetStartMenuShortcutSubfolder( |
| 235 BrowserDistribution::SUBFOLDER_CHROME); | 235 BrowserDistribution::SUBFOLDER_CHROME); |
| 236 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, | 236 ShellUtil::GetShortcutPath( |
| 237 dist_, ShellUtil::CURRENT_USER, &path); | 237 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, |
| 238 dist_, ShellUtil::CURRENT_USER, &path); |
| 238 EXPECT_EQ(fake_start_menu_.path().Append(start_menu_subfolder), | 239 EXPECT_EQ(fake_start_menu_.path().Append(start_menu_subfolder), |
| 239 path); | 240 path); |
| 240 | 241 |
| 241 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, | 242 ShellUtil::GetShortcutPath( |
| 242 dist_, ShellUtil::SYSTEM_LEVEL, &path); | 243 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, |
| 244 dist_, ShellUtil::SYSTEM_LEVEL, &path); |
| 243 EXPECT_EQ(fake_common_start_menu_.path().Append(start_menu_subfolder), | 245 EXPECT_EQ(fake_common_start_menu_.path().Append(start_menu_subfolder), |
| 244 path); | 246 path); |
| 245 } | 247 } |
| 246 | 248 |
| 247 TEST_F(ShellUtilShortcutTest, CreateChromeExeShortcutWithDefaultProperties) { | 249 TEST_F(ShellUtilShortcutTest, CreateChromeExeShortcutWithDefaultProperties) { |
| 248 ShellUtil::ShortcutProperties properties(ShellUtil::CURRENT_USER); | 250 ShellUtil::ShortcutProperties properties(ShellUtil::CURRENT_USER); |
| 249 product_->AddDefaultShortcutProperties(chrome_exe_, &properties); | 251 product_->AddDefaultShortcutProperties(chrome_exe_, &properties); |
| 250 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 252 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( |
| 251 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, properties, | 253 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, properties, |
| 252 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); | 254 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| 253 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, | 255 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, |
| 254 properties); | 256 properties); |
| 255 } | 257 } |
| 256 | 258 |
| 257 TEST_F(ShellUtilShortcutTest, CreateStartMenuShortcutWithAllProperties) { | 259 TEST_F(ShellUtilShortcutTest, CreateStartMenuShortcutWithAllProperties) { |
| 258 test_properties_.set_shortcut_name(L"Bobo le shortcut"); | 260 test_properties_.set_shortcut_name(L"Bobo le shortcut"); |
| 259 test_properties_.level = ShellUtil::SYSTEM_LEVEL; | 261 test_properties_.level = ShellUtil::SYSTEM_LEVEL; |
| 260 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 262 ASSERT_TRUE( |
| 261 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, | 263 ShellUtil::CreateOrUpdateShortcut( |
| 262 dist_, test_properties_, | 264 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, |
| 263 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); | 265 dist_, test_properties_, |
| 264 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, | 266 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| 265 dist_, test_properties_); | 267 ValidateChromeShortcut( |
| 268 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, |
| 269 dist_, test_properties_); |
| 266 } | 270 } |
| 267 | 271 |
| 268 TEST_F(ShellUtilShortcutTest, ReplaceSystemLevelDesktopShortcut) { | 272 TEST_F(ShellUtilShortcutTest, ReplaceSystemLevelDesktopShortcut) { |
| 269 test_properties_.level = ShellUtil::SYSTEM_LEVEL; | 273 test_properties_.level = ShellUtil::SYSTEM_LEVEL; |
| 270 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 274 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( |
| 271 ShellUtil::SHORTCUT_LOCATION_DESKTOP, | 275 ShellUtil::SHORTCUT_LOCATION_DESKTOP, |
| 272 dist_, test_properties_, | 276 dist_, test_properties_, |
| 273 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); | 277 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| 274 | 278 |
| 275 ShellUtil::ShortcutProperties new_properties(ShellUtil::SYSTEM_LEVEL); | 279 ShellUtil::ShortcutProperties new_properties(ShellUtil::SYSTEM_LEVEL); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 ShellUtil::ShortcutProperties expected_properties(test_properties_); | 314 ShellUtil::ShortcutProperties expected_properties(test_properties_); |
| 311 expected_properties.set_arguments(updated_properties.arguments); | 315 expected_properties.set_arguments(updated_properties.arguments); |
| 312 | 316 |
| 313 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist_, | 317 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist_, |
| 314 expected_properties); | 318 expected_properties); |
| 315 } | 319 } |
| 316 | 320 |
| 317 TEST_F(ShellUtilShortcutTest, UpdateAddDualModeToStartMenuShortcut) { | 321 TEST_F(ShellUtilShortcutTest, UpdateAddDualModeToStartMenuShortcut) { |
| 318 ShellUtil::ShortcutProperties properties(ShellUtil::CURRENT_USER); | 322 ShellUtil::ShortcutProperties properties(ShellUtil::CURRENT_USER); |
| 319 product_->AddDefaultShortcutProperties(chrome_exe_, &properties); | 323 product_->AddDefaultShortcutProperties(chrome_exe_, &properties); |
| 320 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 324 ASSERT_TRUE( |
| 321 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, dist_, | 325 ShellUtil::CreateOrUpdateShortcut( |
| 322 properties, ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); | 326 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, dist_, |
| 327 properties, ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| 323 | 328 |
| 324 ShellUtil::ShortcutProperties added_properties(ShellUtil::CURRENT_USER); | 329 ShellUtil::ShortcutProperties added_properties(ShellUtil::CURRENT_USER); |
| 325 added_properties.set_dual_mode(true); | 330 added_properties.set_dual_mode(true); |
| 326 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 331 ASSERT_TRUE( |
| 327 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, dist_, | 332 ShellUtil::CreateOrUpdateShortcut( |
| 328 added_properties, ShellUtil::SHELL_SHORTCUT_UPDATE_EXISTING)); | 333 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, dist_, |
| 334 added_properties, ShellUtil::SHELL_SHORTCUT_UPDATE_EXISTING)); |
| 329 | 335 |
| 330 ShellUtil::ShortcutProperties expected_properties(properties); | 336 ShellUtil::ShortcutProperties expected_properties(properties); |
| 331 expected_properties.set_dual_mode(true); | 337 expected_properties.set_dual_mode(true); |
| 332 | 338 |
| 333 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, | 339 ValidateChromeShortcut( |
| 334 dist_, expected_properties); | 340 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, |
| 341 dist_, expected_properties); |
| 335 } | 342 } |
| 336 | 343 |
| 337 TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevel) { | 344 TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevel) { |
| 338 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 345 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( |
| 339 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_, | 346 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_, |
| 340 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)); | 347 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)); |
| 341 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, | 348 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, |
| 342 test_properties_); | 349 test_properties_); |
| 343 } | 350 } |
| 344 | 351 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 357 test_properties_.level = ShellUtil::CURRENT_USER; | 364 test_properties_.level = ShellUtil::CURRENT_USER; |
| 358 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 365 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( |
| 359 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_, | 366 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_, |
| 360 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)); | 367 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)); |
| 361 ASSERT_FALSE(base::PathExists( | 368 ASSERT_FALSE(base::PathExists( |
| 362 fake_user_desktop_.path().Append(shortcut_name))); | 369 fake_user_desktop_.path().Append(shortcut_name))); |
| 363 } | 370 } |
| 364 | 371 |
| 365 TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevelStartMenu) { | 372 TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevelStartMenu) { |
| 366 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 373 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( |
| 367 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, | 374 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, |
| 368 dist_, test_properties_, | 375 dist_, test_properties_, |
| 369 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)); | 376 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)); |
| 370 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, | 377 ValidateChromeShortcut( |
| 371 dist_, test_properties_); | 378 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, |
| 379 dist_, test_properties_); |
| 372 } | 380 } |
| 373 | 381 |
| 374 TEST_F(ShellUtilShortcutTest, CreateAlwaysUserWithSystemLevelPresent) { | 382 TEST_F(ShellUtilShortcutTest, CreateAlwaysUserWithSystemLevelPresent) { |
| 375 base::string16 shortcut_name( | 383 base::string16 shortcut_name( |
| 376 dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) + | 384 dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) + |
| 377 installer::kLnkExt); | 385 installer::kLnkExt); |
| 378 | 386 |
| 379 test_properties_.level = ShellUtil::SYSTEM_LEVEL; | 387 test_properties_.level = ShellUtil::SYSTEM_LEVEL; |
| 380 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 388 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( |
| 381 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_, | 389 ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, test_properties_, |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 expected_properties3.set_arguments(base::string16()); | 701 expected_properties3.set_arguments(base::string16()); |
| 694 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, | 702 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, |
| 695 expected_properties3); | 703 expected_properties3); |
| 696 expected_properties4.set_arguments(L"--show-app-list"); | 704 expected_properties4.set_arguments(L"--show-app-list"); |
| 697 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, | 705 ValidateChromeShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist_, |
| 698 expected_properties4); | 706 expected_properties4); |
| 699 } | 707 } |
| 700 | 708 |
| 701 TEST_F(ShellUtilShortcutTest, CreateMultipleStartMenuShortcutsAndRemoveFolder) { | 709 TEST_F(ShellUtilShortcutTest, CreateMultipleStartMenuShortcutsAndRemoveFolder) { |
| 702 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 710 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( |
| 703 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, | 711 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, |
| 704 dist_, test_properties_, | 712 dist_, test_properties_, |
| 705 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); | 713 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| 706 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 714 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( |
| 707 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR, | 715 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR, |
| 708 dist_, test_properties_, | 716 dist_, test_properties_, |
| 709 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); | 717 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| 710 test_properties_.set_shortcut_name(L"A second shortcut"); | 718 test_properties_.set_shortcut_name(L"A second shortcut"); |
| 711 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 719 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( |
| 712 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, | 720 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, |
| 713 dist_, test_properties_, | 721 dist_, test_properties_, |
| 714 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); | 722 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| 715 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( | 723 ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( |
| 716 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR, | 724 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR, |
| 717 dist_, test_properties_, | 725 dist_, test_properties_, |
| 718 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); | 726 ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| 719 | 727 |
| 720 base::FilePath chrome_shortcut_folder( | 728 base::FilePath chrome_shortcut_folder( |
| 721 fake_start_menu_.path().Append( | 729 fake_start_menu_.path().Append( |
| 722 dist_->GetStartMenuShortcutSubfolder( | 730 dist_->GetStartMenuShortcutSubfolder( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 736 base::FileEnumerator chrome_apps_file_counter(chrome_apps_shortcut_folder, | 744 base::FileEnumerator chrome_apps_file_counter(chrome_apps_shortcut_folder, |
| 737 false, | 745 false, |
| 738 base::FileEnumerator::FILES); | 746 base::FileEnumerator::FILES); |
| 739 count = 0; | 747 count = 0; |
| 740 while (!chrome_apps_file_counter.Next().empty()) | 748 while (!chrome_apps_file_counter.Next().empty()) |
| 741 ++count; | 749 ++count; |
| 742 EXPECT_EQ(2, count); | 750 EXPECT_EQ(2, count); |
| 743 | 751 |
| 744 ASSERT_TRUE(base::PathExists(chrome_shortcut_folder)); | 752 ASSERT_TRUE(base::PathExists(chrome_shortcut_folder)); |
| 745 ASSERT_TRUE(ShellUtil::RemoveShortcuts( | 753 ASSERT_TRUE(ShellUtil::RemoveShortcuts( |
| 746 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, dist_, | 754 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, dist_, |
| 747 ShellUtil::CURRENT_USER, chrome_exe_)); | 755 ShellUtil::CURRENT_USER, chrome_exe_)); |
| 748 ASSERT_FALSE(base::PathExists(chrome_shortcut_folder)); | 756 ASSERT_FALSE(base::PathExists(chrome_shortcut_folder)); |
| 749 | 757 |
| 750 ASSERT_TRUE(base::PathExists(chrome_apps_shortcut_folder)); | 758 ASSERT_TRUE(base::PathExists(chrome_apps_shortcut_folder)); |
| 751 ASSERT_TRUE(ShellUtil::RemoveShortcuts( | 759 ASSERT_TRUE(ShellUtil::RemoveShortcuts( |
| 752 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR, dist_, | 760 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR, dist_, |
| 753 ShellUtil::CURRENT_USER, chrome_exe_)); | 761 ShellUtil::CURRENT_USER, chrome_exe_)); |
| 754 ASSERT_FALSE(base::PathExists(chrome_apps_shortcut_folder)); | 762 ASSERT_FALSE(base::PathExists(chrome_apps_shortcut_folder)); |
| 755 } | 763 } |
| 756 | 764 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 | 1011 |
| 1004 const base::string16 expected[] = { L"", L"MY", L"MZXQ", L"MZXW6", L"MZXW6YQ", | 1012 const base::string16 expected[] = { L"", L"MY", L"MZXQ", L"MZXW6", L"MZXW6YQ", |
| 1005 L"MZXW6YTB", L"MZXW6YTBOI"}; | 1013 L"MZXW6YTB", L"MZXW6YTBOI"}; |
| 1006 | 1014 |
| 1007 // Run the tests, with one more letter in the input every pass. | 1015 // Run the tests, with one more letter in the input every pass. |
| 1008 for (int i = 0; i < arraysize(expected); ++i) { | 1016 for (int i = 0; i < arraysize(expected); ++i) { |
| 1009 ASSERT_EQ(expected[i], | 1017 ASSERT_EQ(expected[i], |
| 1010 ShellUtil::ByteArrayToBase32(test_array, i)); | 1018 ShellUtil::ByteArrayToBase32(test_array, i)); |
| 1011 } | 1019 } |
| 1012 } | 1020 } |
| OLD | NEW |