Fix and re-commit http://codereview.chromium.org/10914109/ (after revert in http://crrev.com/155918) -- Refactoring and tests for the highly undertested file_util::CreateOrUpdateShortcutLink() method.
Simplify file_util::CreateOrUpdateShortcutLink()'s interface (use a struct to set parameters passed which allows callers to specify exactly what they want without having to pass in a bunch of NULLs for the unused parameters).
The same concept will be used for ShellUtil's shortcut functions in an upcoming CL.
Moved ShellUtil::VerifyChromeShortcut() to file_util::VerifyShortcut() and augmented it for every shortcut properties. This will also allow other shortcut creators (web apps, profiles, etc.) to have a broader test coverage on the shortcut they create (i.e. more testable properties available).
I will leave it up to the owners of these various projects to augment their tests, this CL keeps the previously tested behavior, not more, not less.
This is the 1st CL of a massive refactoring effort for shortcuts (http://goo.gl/Az889) in which ShellUtil's shortcut methods have to be refactored (http://codereview.chromium.org/10836247/ : soon to incorporate interface changes from this CL) which led me even lower to first refactor file_util's shortcut methods.
[email protected], [email protected], [email protected], [email protected]
BUG=132825, 148539
TEST=base_unittests --gtest_filter=FileUtilShortcutTest*
installer_util_unitests --gtest_filter=ShellUtilTestWithDirAndDist*
unit_tests --gtest_filter=ProfileShortcutManagerTest*
(run tests on XP as well)
Review URL: https://chromiumcodereview.appspot.com/10909171
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156250 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/base.gyp b/base/base.gyp
index 6384ac9..1aa6269 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -523,6 +523,7 @@
'win/scoped_bstr_unittest.cc',
'win/scoped_comptr_unittest.cc',
'win/scoped_process_information_unittest.cc',
+ 'win/shortcut_unittest.cc',
'win/startup_information_unittest.cc',
'win/scoped_variant_unittest.cc',
'win/win_util_unittest.cc',
@@ -688,6 +689,17 @@
'test/test_file_util_linux.cc',
],
}],
+ ['OS=="win"', {
+ 'direct_dependent_settings': {
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'DelayLoadDLLs': [
+ 'propsys.dll',
+ ],
+ },
+ },
+ },
+ }],
],
'sources': [
'perftimer.cc',
@@ -720,6 +732,8 @@
'test/test_listener_ios.mm',
'test/test_reg_util_win.cc',
'test/test_reg_util_win.h',
+ 'test/test_shortcut_win.cc',
+ 'test/test_shortcut_win.h',
'test/test_suite.cc',
'test/test_suite.h',
'test/test_support_android.cc',