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

Side by Side Diff: webkit/tools/test_shell/test_shell_win.cc

Issue 12893: Get rid of kPathSeparator on windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <windows.h> 5 #include <windows.h>
6 #include <atlbase.h> 6 #include <atlbase.h>
7 #include <commdlg.h> 7 #include <commdlg.h>
8 #include <objbase.h> 8 #include <objbase.h>
9 #include <shlwapi.h> 9 #include <shlwapi.h>
10 #include <wininet.h> 10 #include <wininet.h>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // Warning: Don't use the heap in this function. It may be corrupted. 85 // Warning: Don't use the heap in this function. It may be corrupted.
86 if (!g_currentTestName[0]) 86 if (!g_currentTestName[0])
87 return false; 87 return false;
88 88
89 // Try to rename the minidump file to include the crashed test's name. 89 // Try to rename the minidump file to include the crashed test's name.
90 // StackString uses the stack but overflows onto the heap. But we don't 90 // StackString uses the stack but overflows onto the heap. But we don't
91 // care too much about being completely correct here, since most crashes 91 // care too much about being completely correct here, since most crashes
92 // will be happening on developers' machines where they have debuggers. 92 // will be happening on developers' machines where they have debuggers.
93 StackWString<kPathBufSize * 2> origPath; 93 StackWString<kPathBufSize * 2> origPath;
94 origPath->append(dumpPath); 94 origPath->append(dumpPath);
95 origPath->push_back(file_util::kPathSeparator); 95 origPath->push_back(FilePath::kSeparators[0]);
96 origPath->append(minidumpID); 96 origPath->append(minidumpID);
97 origPath->append(L".dmp"); 97 origPath->append(L".dmp");
98 98
99 StackWString<kPathBufSize * 2> newPath; 99 StackWString<kPathBufSize * 2> newPath;
100 newPath->append(dumpPath); 100 newPath->append(dumpPath);
101 newPath->push_back(file_util::kPathSeparator); 101 newPath->push_back(FilePath::kSeparators[0]);
102 newPath->append(g_currentTestName); 102 newPath->append(g_currentTestName);
103 newPath->append(L"-"); 103 newPath->append(L"-");
104 newPath->append(minidumpID); 104 newPath->append(minidumpID);
105 newPath->append(L".dmp"); 105 newPath->append(L".dmp");
106 106
107 // May use the heap, but oh well. If this fails, we'll just have the 107 // May use the heap, but oh well. If this fails, we'll just have the
108 // original dump file lying around. 108 // original dump file lying around.
109 _wrename(origPath->c_str(), newPath->c_str()); 109 _wrename(origPath->c_str(), newPath->c_str());
110 110
111 return false; 111 return false;
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 std::string new_url(url); 322 std::string new_url(url);
323 if (url.compare(0, kPrefixLen, kPrefix, kPrefixLen) == 0) { 323 if (url.compare(0, kPrefixLen, kPrefix, kPrefixLen) == 0) {
324 std::wstring replace_url; 324 std::wstring replace_url;
325 PathService::Get(base::DIR_EXE, &replace_url); 325 PathService::Get(base::DIR_EXE, &replace_url);
326 file_util::UpOneDirectory(&replace_url); 326 file_util::UpOneDirectory(&replace_url);
327 file_util::UpOneDirectory(&replace_url); 327 file_util::UpOneDirectory(&replace_url);
328 file_util::AppendToPath(&replace_url, L"webkit"); 328 file_util::AppendToPath(&replace_url, L"webkit");
329 file_util::AppendToPath(&replace_url, L"data"); 329 file_util::AppendToPath(&replace_url, L"data");
330 file_util::AppendToPath(&replace_url, L"layout_tests"); 330 file_util::AppendToPath(&replace_url, L"layout_tests");
331 file_util::AppendToPath(&replace_url, L"LayoutTests"); 331 file_util::AppendToPath(&replace_url, L"LayoutTests");
332 replace_url.push_back(file_util::kPathSeparator); 332 replace_url.push_back(FilePath::kSeparators[0]);
333 new_url = std::string("file:///") + 333 new_url = std::string("file:///") +
334 WideToUTF8(replace_url).append(url.substr(kPrefixLen)); 334 WideToUTF8(replace_url).append(url.substr(kPrefixLen));
335 } 335 }
336 return new_url; 336 return new_url;
337 } 337 }
338 338
339 339
340 340
341 ///////////////////////////////////////////////////////////////////////////// 341 /////////////////////////////////////////////////////////////////////////////
342 // TestShell implementation 342 // TestShell implementation
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 766
767 bool DownloadUrl(const std::string& url, HWND caller_window) { 767 bool DownloadUrl(const std::string& url, HWND caller_window) {
768 return false; 768 return false;
769 } 769 }
770 770
771 ScreenInfo GetScreenInfo(gfx::ViewHandle window) { 771 ScreenInfo GetScreenInfo(gfx::ViewHandle window) {
772 return GetScreenInfoHelper(window); 772 return GetScreenInfoHelper(window);
773 } 773 }
774 774
775 } // namespace webkit_glue 775 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « net/base/net_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698