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

Side by Side Diff: base/file_util_unittest.cc

Issue 399045: Set prop app id for chromium/application shortcut. (Closed)
Patch Set: more for hbono Created 11 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 TEST_F(FileUtilTest, CreateShortcutTest) { 982 TEST_F(FileUtilTest, CreateShortcutTest) {
983 const wchar_t file_contents[] = L"This is another target."; 983 const wchar_t file_contents[] = L"This is another target.";
984 FilePath target_file = test_dir_.Append(L"Target1.txt"); 984 FilePath target_file = test_dir_.Append(L"Target1.txt");
985 CreateTextFile(target_file, file_contents); 985 CreateTextFile(target_file, file_contents);
986 986
987 FilePath link_file = test_dir_.Append(L"Link1.lnk"); 987 FilePath link_file = test_dir_.Append(L"Link1.lnk");
988 988
989 CoInitialize(NULL); 989 CoInitialize(NULL);
990 EXPECT_TRUE(file_util::CreateShortcutLink(target_file.value().c_str(), 990 EXPECT_TRUE(file_util::CreateShortcutLink(target_file.value().c_str(),
991 link_file.value().c_str(), 991 link_file.value().c_str(),
992 NULL, NULL, NULL, NULL, 0)); 992 NULL, NULL, NULL, NULL, 0, NULL));
993 FilePath resolved_name = link_file; 993 FilePath resolved_name = link_file;
994 EXPECT_TRUE(file_util::ResolveShortcut(&resolved_name)); 994 EXPECT_TRUE(file_util::ResolveShortcut(&resolved_name));
995 std::wstring read_contents = ReadTextFile(resolved_name); 995 std::wstring read_contents = ReadTextFile(resolved_name);
996 EXPECT_EQ(file_contents, read_contents); 996 EXPECT_EQ(file_contents, read_contents);
997 997
998 DeleteFile(target_file.value().c_str()); 998 DeleteFile(target_file.value().c_str());
999 DeleteFile(link_file.value().c_str()); 999 DeleteFile(link_file.value().c_str());
1000 CoUninitialize(); 1000 CoUninitialize();
1001 } 1001 }
1002 1002
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 #elif defined(OS_LINUX) 1355 #elif defined(OS_LINUX)
1356 EXPECT_FALSE(file_util::ContainsPath(foo, 1356 EXPECT_FALSE(file_util::ContainsPath(foo,
1357 foo_caps.Append(FILE_PATH_LITERAL("bar.txt")))); 1357 foo_caps.Append(FILE_PATH_LITERAL("bar.txt"))));
1358 #else 1358 #else
1359 // We can't really do this test on osx since the case-sensitivity of the 1359 // We can't really do this test on osx since the case-sensitivity of the
1360 // filesystem is configurable. 1360 // filesystem is configurable.
1361 #endif 1361 #endif
1362 } 1362 }
1363 1363
1364 } // namespace 1364 } // namespace
OLDNEW
« no previous file with comments | « base/file_util.h ('k') | base/file_util_win.cc » ('j') | base/win_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698