Index: content/shell/webkit_test_runner_host.cc |
diff --git a/content/shell/webkit_test_runner_host.cc b/content/shell/webkit_test_runner_host.cc |
index 03ca79e013da3ad17a0a965e3dd93bfb91a20646..74fe85ea0f81bea224f761a072873d117569ce77 100644 |
--- a/content/shell/webkit_test_runner_host.cc |
+++ b/content/shell/webkit_test_runner_host.cc |
@@ -93,9 +93,13 @@ void WebKitTestResultPrinter::PrintImageFooter() { |
} |
void WebKitTestResultPrinter::AddMessage(const std::string& message) { |
+ AddMessageRaw(message + "\n"); |
+} |
+ |
+void WebKitTestResultPrinter::AddMessageRaw(const std::string& message) { |
if (state_ != IN_TEXT_BLOCK) |
return; |
- *output_ << message << "\n"; |
+ *output_ << message; |
} |
void WebKitTestResultPrinter::AddErrorMessage(const std::string& message) { |
@@ -152,6 +156,7 @@ bool WebKitTestController::PrepareForLayoutTest( |
NULL, |
MSG_ROUTING_NONE, |
NULL); |
+ did_set_as_main_window_ = false; |
Observe(main_window_->web_contents()); |
return true; |
} |
@@ -168,12 +173,14 @@ bool WebKitTestController::ResetAfterLayoutTest() { |
is_printing_ = false; |
should_stay_on_page_after_handling_before_unload_ = false; |
wait_until_done_ = false; |
+ did_set_as_main_window_ = false; |
watchdog_.Cancel(); |
if (main_window_) { |
Observe(NULL); |
main_window_ = NULL; |
} |
Shell::CloseAllWindows(); |
+ Send(new ShellViewMsg_ResetAll); |
return true; |
} |
@@ -214,6 +221,7 @@ bool WebKitTestController::OnMessageReceived(const IPC::Message& message) { |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP(WebKitTestController, message) |
IPC_MESSAGE_HANDLER(ShellViewHostMsg_DidFinishLoad, OnDidFinishLoad) |
+ IPC_MESSAGE_HANDLER(ShellViewHostMsg_PrintMessage, OnPrintMessage) |
IPC_MESSAGE_HANDLER(ShellViewHostMsg_TextDump, OnTextDump) |
IPC_MESSAGE_HANDLER(ShellViewHostMsg_ImageDump, OnImageDump) |
IPC_MESSAGE_UNHANDLED(handled = false) |
@@ -226,6 +234,16 @@ void WebKitTestController::PluginCrashed(const FilePath& plugin_path) { |
printer_->AddErrorMessage("#CRASHED - plugin"); |
} |
+void WebKitTestController::RenderViewReady() { |
+ if (did_set_as_main_window_) |
+ return; |
+ RenderViewHost* render_view_host = |
+ main_window_->web_contents()->GetRenderViewHost(); |
+ render_view_host->Send(new ShellViewMsg_SetIsMainWindow( |
+ render_view_host->GetRoutingID())); |
+ did_set_as_main_window_ = true; |
+} |
+ |
void WebKitTestController::RenderViewGone(base::TerminationStatus status) { |
printer_->AddErrorMessage("#CRASHED - renderer"); |
} |
@@ -321,6 +339,10 @@ void WebKitTestController::OnTextDump(const std::string& dump) { |
} |
} |
+void WebKitTestController::OnPrintMessage(const std::string& message) { |
+ printer_->AddMessageRaw(message); |
+} |
+ |
// WebKitTestRunnerHost ------------------------------------------------------- |
WebKitTestRunnerHost::WebKitTestRunnerHost( |