summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-09 22:22:03 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-09 22:22:03 +0000
commit9729014ba89b63f41524a8ed3378b37dae94147f (patch)
tree2c1df8fdda4c875c2e01753b571e5397272e83e1 /webkit/tools/test_shell
parent19b430eadca0069a350558c6fff17cf7fc86dc54 (diff)
downloadchromium_src-9729014ba89b63f41524a8ed3378b37dae94147f.zip
chromium_src-9729014ba89b63f41524a8ed3378b37dae94147f.tar.gz
chromium_src-9729014ba89b63f41524a8ed3378b37dae94147f.tar.bz2
test_shell: remove some uses of ToWStringHack
Also removes some layout-test related code, since we no longer use test_shell for layout tests. BUG=69467 Review URL: http://codereview.chromium.org/6660006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77532 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell')
-rw-r--r--webkit/tools/test_shell/test_shell.cc4
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc44
2 files changed, 9 insertions, 39 deletions
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index f106c35..40eb490 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -651,8 +651,8 @@ bool IsDefaultPluginEnabled() {
FilePath exe_path;
if (PathService::Get(base::FILE_EXE, &exe_path)) {
- std::wstring exe_name = exe_path.BaseName().ToWStringHack();
- if (StartsWith(exe_name, L"test_shell_tests", false))
+ std::string exe_name = exe_path.BaseName().MaybeAsASCII();
+ if (StartsWithASCII(exe_name, "test_shell_tests", false))
return true;
}
return false;
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index 25a2670..ad6de9e 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -140,21 +140,6 @@ const char* kIllegalString = "illegal value";
int next_page_id_ = 1;
-// Used to write a platform neutral file:/// URL by only taking the filename
-// (e.g., converts "file:///tmp/foo.txt" to just "foo.txt").
-std::string UrlSuitableForTestResult(const std::string& url) {
- if (url.empty() || std::string::npos == url.find("file://"))
- return url;
-
- // TODO: elsewhere in the codebase we use net::FormatUrl() for this.
- std::string filename =
- WideToUTF8(FilePath::FromWStringHack(UTF8ToWide(url))
- .BaseName().ToWStringHack());
- if (filename.empty())
- return "file:"; // A WebKit test has this in its expected output.
- return filename;
-}
-
// Used to write a platform neutral file:/// URL by taking the
// filename and its directory. (e.g., converts
// "file:///tmp/foo/bar.txt" to just "bar.txt").
@@ -352,28 +337,13 @@ WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace(
void TestWebViewDelegate::didAddMessageToConsole(
const WebConsoleMessage& message, const WebString& source_name,
unsigned source_line) {
- if (!shell_->layout_test_mode()) {
- logging::LogMessage("CONSOLE", 0).stream() << "\""
- << message.text.utf8().data()
- << ",\" source: "
- << source_name.utf8().data()
- << "("
- << source_line
- << ")";
- } else {
- // This matches win DumpRenderTree's UIDelegate.cpp.
- std::string new_message;
- if (!message.text.isEmpty()) {
- new_message = message.text.utf8();
- size_t file_protocol = new_message.find("file://");
- if (file_protocol != std::string::npos) {
- new_message = new_message.substr(0, file_protocol) +
- UrlSuitableForTestResult(new_message.substr(file_protocol));
- }
- }
-
- printf("CONSOLE MESSAGE: line %d: %s\n", source_line, new_message.data());
- }
+ logging::LogMessage("CONSOLE", 0).stream() << "\""
+ << message.text.utf8().data()
+ << ",\" source: "
+ << source_name.utf8().data()
+ << "("
+ << source_line
+ << ")";
}
void TestWebViewDelegate::didStartLoading() {