summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/test_shell.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/tools/test_shell/test_shell.cc')
-rw-r--r--webkit/tools/test_shell/test_shell.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index 39c5121..c745db3 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -94,8 +94,8 @@ class URLRequestTestShellFileJob : public URLRequestFileJob {
const std::string& scheme) {
std::wstring path;
PathService::Get(base::DIR_EXE, &path);
- file_util::AppendToPath(&path, L"Resources");
- file_util::AppendToPath(&path, L"Inspector");
+ file_util::AppendToPath(&path, L"resources");
+ file_util::AppendToPath(&path, L"inspector");
file_util::AppendToPath(&path, UTF8ToWide(request->url().path()));
return new URLRequestTestShellFileJob(request,
FilePath::FromWStringHack(path));
@@ -432,6 +432,26 @@ void TestShell::GoBackOrForward(int offset) {
navigation_controller_->GoToOffset(offset);
}
+void TestShell::DumpDocumentText() {
+ std::wstring file_path;
+ if (!PromptForSaveFile(L"Dump document text", &file_path))
+ return;
+
+ const std::string data =
+ WideToUTF8(webkit_glue::DumpDocumentText(webView()->GetMainFrame()));
+ file_util::WriteFile(file_path, data.c_str(), data.length());
+}
+
+void TestShell::DumpRenderTree() {
+ std::wstring file_path;
+ if (!PromptForSaveFile(L"Dump render tree", &file_path))
+ return;
+
+ const std::string data =
+ WideToUTF8(webkit_glue::DumpRenderer(webView()->GetMainFrame()));
+ file_util::WriteFile(file_path, data.c_str(), data.length());
+}
+
std::wstring TestShell::GetDocumentText() {
return webkit_glue::DumpDocumentText(webView()->GetMainFrame());
}