| Index: base/file_util_unittest.cc
|
| diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
|
| index 5a999839e79612fb5b3aca59c9be3149a6ad2e36..04de367ec0f6433b5f80b655819a21013b992e59 100644
|
| --- a/base/file_util_unittest.cc
|
| +++ b/base/file_util_unittest.cc
|
| @@ -1592,75 +1592,6 @@ TEST_F(ReadOnlyFileUtilTest, TextContentsEqual) {
|
|
|
| // We don't need equivalent functionality outside of Windows.
|
| #if defined(OS_WIN)
|
| -TEST_F(FileUtilTest, ResolveShortcutTest) {
|
| - FilePath target_file = temp_dir_.path().Append(L"Target.txt");
|
| - CreateTextFile(target_file, L"This is the target.");
|
| -
|
| - FilePath link_file = temp_dir_.path().Append(L"Link.lnk");
|
| -
|
| - HRESULT result;
|
| - IShellLink* shell = NULL;
|
| - IPersistFile* persist = NULL;
|
| -
|
| - CoInitialize(NULL);
|
| - // Temporarily create a shortcut for test
|
| - result = CoCreateInstance(CLSID_ShellLink, NULL,
|
| - CLSCTX_INPROC_SERVER, IID_IShellLink,
|
| - reinterpret_cast<LPVOID*>(&shell));
|
| - EXPECT_TRUE(SUCCEEDED(result));
|
| - result = shell->QueryInterface(IID_IPersistFile,
|
| - reinterpret_cast<LPVOID*>(&persist));
|
| - EXPECT_TRUE(SUCCEEDED(result));
|
| - result = shell->SetPath(target_file.value().c_str());
|
| - EXPECT_TRUE(SUCCEEDED(result));
|
| - result = shell->SetDescription(L"ResolveShortcutTest");
|
| - EXPECT_TRUE(SUCCEEDED(result));
|
| - result = shell->SetArguments(L"--args");
|
| - EXPECT_TRUE(SUCCEEDED(result));
|
| - result = persist->Save(link_file.value().c_str(), TRUE);
|
| - EXPECT_TRUE(SUCCEEDED(result));
|
| - if (persist)
|
| - persist->Release();
|
| - if (shell)
|
| - shell->Release();
|
| -
|
| - bool is_solved;
|
| - std::wstring args;
|
| - is_solved = file_util::ResolveShortcut(link_file, &link_file, &args);
|
| - EXPECT_TRUE(is_solved);
|
| - EXPECT_EQ(L"--args", args);
|
| - std::wstring contents;
|
| - contents = ReadTextFile(link_file);
|
| - EXPECT_EQ(L"This is the target.", contents);
|
| -
|
| - // Cleaning
|
| - DeleteFile(target_file.value().c_str());
|
| - DeleteFile(link_file.value().c_str());
|
| - CoUninitialize();
|
| -}
|
| -
|
| -TEST_F(FileUtilTest, CreateShortcutTest) {
|
| - const wchar_t* file_contents = L"This is another target.";
|
| - FilePath target_file = temp_dir_.path().Append(L"Target1.txt");
|
| - CreateTextFile(target_file, file_contents);
|
| -
|
| - FilePath link_file = temp_dir_.path().Append(L"Link1.lnk");
|
| -
|
| - CoInitialize(NULL);
|
| - EXPECT_TRUE(file_util::CreateOrUpdateShortcutLink(
|
| - target_file.value().c_str(), link_file.value().c_str(), NULL,
|
| - NULL, NULL, NULL, 0, NULL,
|
| - file_util::SHORTCUT_CREATE_ALWAYS));
|
| - FilePath resolved_name;
|
| - EXPECT_TRUE(file_util::ResolveShortcut(link_file, &resolved_name, NULL));
|
| - std::wstring read_contents = ReadTextFile(resolved_name);
|
| - EXPECT_EQ(file_contents, read_contents);
|
| -
|
| - DeleteFile(target_file.value().c_str());
|
| - DeleteFile(link_file.value().c_str());
|
| - CoUninitialize();
|
| -}
|
| -
|
| TEST_F(FileUtilTest, CopyAndDeleteDirectoryTest) {
|
| // Create a directory
|
| FilePath dir_name_from =
|
|
|