Commit 87847d71 authored by jochen@chromium.org's avatar jochen@chromium.org

Make content_shell talk to run_webkit_tests.py

This adds the command line option --check-layout-test-systems-deps (which just
checks that content_shell can initialize itself), and prints the necessary
block markers around the text output required by run_webkit_test.py

BUG=111316
TEST=none
NOTRY=true


Review URL: https://chromiumcodereview.appspot.com/10413050

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138303 0039d316-1c4b-4281-b951-d872f2087c98
parent 247b2463
......@@ -4,6 +4,8 @@
#include "content/shell/shell_browser_main.h"
#include <iostream>
#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
......@@ -67,6 +69,11 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) {
if (exit_code >= 0)
return exit_code;
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kCheckLayoutTestSysDeps)) {
return 0;
}
bool layout_test_mode =
CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree);
......@@ -82,8 +89,7 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) {
*new_line_position = '\0';
if (test_string[0] == '\0')
continue;
if (!strcmp(test_string, "QUIT"))
break;
content::Shell::CreateNewWindow(browser_context,
GetURLForLayoutTest(test_string),
NULL,
......@@ -92,6 +98,11 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) {
main_runner_->Run();
content::Shell::CloseAllWindows();
// Test footer.
std::cout << "#EOF\n";
std::cout.flush();
}
exit_code = 0;
} else {
......
......@@ -38,7 +38,11 @@ bool ShellRenderViewHostObserver::OnMessageReceived(
}
void ShellRenderViewHostObserver::OnTextDump(const std::string& dump) {
std::cout << "Content-Type: text/plain\n";
std::cout << dump;
std::cout << "#EOF\n";
std::cerr << "#EOF\n";
MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
}
......
......@@ -6,6 +6,9 @@
namespace switches {
// Check whether all system dependencies for running layout tests are met.
const char kCheckLayoutTestSysDeps[] = "check-layout-test-sys-deps";
// Request pages to be dumped as text once they finished loading.
const char kDumpRenderTree[] = "dump-render-tree";
......
......@@ -10,6 +10,7 @@
namespace switches {
extern const char kCheckLayoutTestSysDeps[];
extern const char kDumpRenderTree[];
} // namespace switches
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment