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

Unified Diff: webkit/tools/test_shell/test_shell_mac.mm

Issue 12489: Remove file_util::kPathSeparator from posix. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/tools/test_shell/test_shell_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/test_shell_mac.mm
===================================================================
--- webkit/tools/test_shell/test_shell_mac.mm (revision 6039)
+++ webkit/tools/test_shell/test_shell_mac.mm (working copy)
@@ -576,7 +576,7 @@
std::wstring file_path;
if (!PromptForSaveFile(L"Dump document text", &file_path))
return;
-
+
WriteTextToFile(
WideToUTF8(webkit_glue::DumpDocumentText(webView()->GetMainFrame())),
WideToUTF8(file_path));
@@ -587,33 +587,28 @@
std::wstring file_path;
if (!PromptForSaveFile(L"Dump render tree", &file_path))
return;
-
+
WriteTextToFile(
WideToUTF8(webkit_glue::DumpRenderer(webView()->GetMainFrame())),
WideToUTF8(file_path));
}
-/* static */
+// static
std::string TestShell::RewriteLocalUrl(const std::string& url) {
// Convert file:///tmp/LayoutTests urls to the actual location on disk.
const char kPrefix[] = "file:///tmp/LayoutTests/";
const int kPrefixLen = arraysize(kPrefix) - 1;
-
+
std::string new_url(url);
if (url.compare(0, kPrefixLen, kPrefix, kPrefixLen) == 0) {
- std::wstring replace_url;
- PathService::Get(base::DIR_EXE, &replace_url);
- file_util::UpOneDirectory(&replace_url);
- file_util::UpOneDirectory(&replace_url);
- file_util::AppendToPath(&replace_url, L"webkit");
- file_util::AppendToPath(&replace_url, L"data");
- file_util::AppendToPath(&replace_url, L"layout_tests");
- file_util::AppendToPath(&replace_url, L"LayoutTests");
- replace_url.push_back(file_util::kPathSeparator);
- std::string replace_url8 = WideToUTF8(replace_url);
- new_url = std::string("file:///") +
- replace_url8.append(url.substr(kPrefixLen));
+ FilePath replace_path;
+ PathService::Get(base::DIR_EXE, &replace_path);
+ replace_path = replace_path.DirName().DirName().Append(
+ "webkit/data/layout_tests/LayoutTests/");
+ new_url = std::string("file://") + replace_path.value() +
+ url.substr(kPrefixLen);
}
+
return new_url;
}
@@ -629,7 +624,7 @@
std::wstring GetLocalizedString(int message_id) {
NSString* idString = [NSString stringWithFormat:@"%d", message_id];
NSString* localString = NSLocalizedString(idString, @"");
-
+
return UTF8ToWide([localString UTF8String]);
}
« no previous file with comments | « webkit/tools/test_shell/test_shell_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698