diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-08 11:15:26 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-08 11:15:26 +0000 |
commit | ec0722e0916a2215fcf9a7859b17214d400d164b (patch) | |
tree | 3379b9f25849c8d94fe44d4b202979df2ad6cb83 /webkit/tools/test_shell/test_shell.cc | |
parent | 26034f0bb2f9644453815cbaee214c865deb2f8b (diff) | |
download | chromium_src-ec0722e0916a2215fcf9a7859b17214d400d164b.zip chromium_src-ec0722e0916a2215fcf9a7859b17214d400d164b.tar.gz chromium_src-ec0722e0916a2215fcf9a7859b17214d400d164b.tar.bz2 |
Add debug menu to Linux test_shell:
- Dump body text...
- Dump render tree...
- Show web inspector...
BUG=5122, 6050
Review URL: http://codereview.chromium.org/16578
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7724 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/test_shell.cc')
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 24 |
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()); } |