| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/shell/renderer/layout_test/layout_test_render_frame_observer.h
" | 5 #include "content/shell/renderer/layout_test/layout_test_render_frame_observer.h
" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" |
| 9 #include "components/test_runner/layout_dump.h" | 10 #include "components/test_runner/layout_dump.h" |
| 10 #include "components/test_runner/layout_dump_flags.h" | 11 #include "components/test_runner/layout_dump_flags.h" |
| 11 #include "components/test_runner/web_test_interfaces.h" | 12 #include "components/test_runner/web_test_interfaces.h" |
| 12 #include "components/test_runner/web_test_runner.h" | 13 #include "components/test_runner/web_test_runner.h" |
| 13 #include "content/public/renderer/render_frame.h" | 14 #include "content/public/renderer/render_frame.h" |
| 14 #include "content/shell/common/shell_messages.h" | 15 #include "content/shell/common/shell_messages.h" |
| 16 #include "content/shell/common/shell_switches.h" |
| 15 #include "content/shell/renderer/layout_test/blink_test_runner.h" | 17 #include "content/shell/renderer/layout_test/blink_test_runner.h" |
| 16 #include "content/shell/renderer/layout_test/layout_test_render_process_observer
.h" | 18 #include "content/shell/renderer/layout_test/layout_test_render_process_observer
.h" |
| 17 #include "ipc/ipc_message_macros.h" | 19 #include "ipc/ipc_message_macros.h" |
| 18 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 20 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 19 | 21 |
| 20 namespace content { | 22 namespace content { |
| 21 | 23 |
| 22 LayoutTestRenderFrameObserver::LayoutTestRenderFrameObserver( | 24 LayoutTestRenderFrameObserver::LayoutTestRenderFrameObserver( |
| 23 RenderFrame* render_frame) | 25 RenderFrame* render_frame) |
| 24 : RenderFrameObserver(render_frame) { | 26 : RenderFrameObserver(render_frame) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 37 IPC_MESSAGE_HANDLER(ShellViewMsg_ReplicateTestConfiguration, | 39 IPC_MESSAGE_HANDLER(ShellViewMsg_ReplicateTestConfiguration, |
| 38 OnReplicateTestConfiguration) | 40 OnReplicateTestConfiguration) |
| 39 IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration, | 41 IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration, |
| 40 OnSetTestConfiguration) | 42 OnSetTestConfiguration) |
| 41 IPC_MESSAGE_UNHANDLED(handled = false) | 43 IPC_MESSAGE_UNHANDLED(handled = false) |
| 42 IPC_END_MESSAGE_MAP() | 44 IPC_END_MESSAGE_MAP() |
| 43 | 45 |
| 44 return handled; | 46 return handled; |
| 45 } | 47 } |
| 46 | 48 |
| 47 void LayoutTestRenderFrameObserver::OnLayoutDumpRequest( | 49 void LayoutTestRenderFrameObserver::OnLayoutDumpRequest() { |
| 48 const test_runner::LayoutDumpFlags& layout_dump_flags) { | 50 test_runner::LayoutDumpFlags layout_dump_flags = |
| 51 LayoutTestRenderProcessObserver::GetInstance() |
| 52 ->test_interfaces() |
| 53 ->TestRunner() |
| 54 ->GetLayoutDumpFlags(); |
| 55 |
| 49 std::string dump = | 56 std::string dump = |
| 50 test_runner::DumpLayout(render_frame()->GetWebFrame(), layout_dump_flags); | 57 test_runner::DumpLayout(render_frame()->GetWebFrame(), layout_dump_flags); |
| 58 |
| 51 Send(new ShellViewHostMsg_LayoutDumpResponse(routing_id(), dump)); | 59 Send(new ShellViewHostMsg_LayoutDumpResponse(routing_id(), dump)); |
| 52 } | 60 } |
| 53 | 61 |
| 54 void LayoutTestRenderFrameObserver::OnReplicateTestConfiguration( | 62 void LayoutTestRenderFrameObserver::OnReplicateTestConfiguration( |
| 55 const ShellTestConfiguration& test_config) { | 63 const ShellTestConfiguration& test_config) { |
| 56 LayoutTestRenderProcessObserver::GetInstance() | 64 LayoutTestRenderProcessObserver::GetInstance() |
| 57 ->main_test_runner() | 65 ->main_test_runner() |
| 58 ->OnReplicateTestConfiguration(test_config); | 66 ->OnReplicateTestConfiguration(test_config); |
| 59 } | 67 } |
| 60 | 68 |
| 61 void LayoutTestRenderFrameObserver::OnSetTestConfiguration( | 69 void LayoutTestRenderFrameObserver::OnSetTestConfiguration( |
| 62 const ShellTestConfiguration& test_config) { | 70 const ShellTestConfiguration& test_config) { |
| 63 LayoutTestRenderProcessObserver::GetInstance() | 71 LayoutTestRenderProcessObserver::GetInstance() |
| 64 ->main_test_runner() | 72 ->main_test_runner() |
| 65 ->OnSetTestConfiguration(test_config); | 73 ->OnSetTestConfiguration(test_config); |
| 66 } | 74 } |
| 67 | 75 |
| 68 } // namespace content | 76 } // namespace content |
| OLD | NEW |