| 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 "components/test_runner/web_test_interfaces.h" | 9 #include "components/test_runner/web_test_interfaces.h" |
| 10 #include "components/test_runner/web_test_runner.h" | 10 #include "components/test_runner/web_test_runner.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 ->test_interfaces() | 25 ->test_interfaces() |
| 26 ->TestRunner() | 26 ->TestRunner() |
| 27 ->GetWebContentSettings()); | 27 ->GetWebContentSettings()); |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool LayoutTestRenderFrameObserver::OnMessageReceived( | 30 bool LayoutTestRenderFrameObserver::OnMessageReceived( |
| 31 const IPC::Message& message) { | 31 const IPC::Message& message) { |
| 32 bool handled = true; | 32 bool handled = true; |
| 33 IPC_BEGIN_MESSAGE_MAP(LayoutTestRenderFrameObserver, message) | 33 IPC_BEGIN_MESSAGE_MAP(LayoutTestRenderFrameObserver, message) |
| 34 IPC_MESSAGE_HANDLER(ShellViewMsg_LayoutDumpRequest, OnLayoutDumpRequest) | 34 IPC_MESSAGE_HANDLER(ShellViewMsg_LayoutDumpRequest, OnLayoutDumpRequest) |
| 35 IPC_MESSAGE_HANDLER(ShellViewMsg_ReplicateLayoutTestRuntimeFlagsChanges, | |
| 36 OnReplicateLayoutTestRuntimeFlagsChanges) | |
| 37 IPC_MESSAGE_HANDLER(ShellViewMsg_ReplicateTestConfiguration, | 35 IPC_MESSAGE_HANDLER(ShellViewMsg_ReplicateTestConfiguration, |
| 38 OnReplicateTestConfiguration) | 36 OnReplicateTestConfiguration) |
| 39 IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration, | 37 IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration, |
| 40 OnSetTestConfiguration) | 38 OnSetTestConfiguration) |
| 41 IPC_MESSAGE_HANDLER(ShellViewMsg_SetupSecondaryRenderer, | 39 IPC_MESSAGE_HANDLER(ShellViewMsg_SetupSecondaryRenderer, |
| 42 OnSetupSecondaryRenderer) | 40 OnSetupSecondaryRenderer) |
| 43 IPC_MESSAGE_UNHANDLED(handled = false) | 41 IPC_MESSAGE_UNHANDLED(handled = false) |
| 44 IPC_END_MESSAGE_MAP() | 42 IPC_END_MESSAGE_MAP() |
| 45 | 43 |
| 46 return handled; | 44 return handled; |
| 47 } | 45 } |
| 48 | 46 |
| 49 void LayoutTestRenderFrameObserver::OnLayoutDumpRequest() { | 47 void LayoutTestRenderFrameObserver::OnLayoutDumpRequest() { |
| 50 std::string dump = | 48 std::string dump = |
| 51 LayoutTestRenderProcessObserver::GetInstance() | 49 LayoutTestRenderProcessObserver::GetInstance() |
| 52 ->test_interfaces() | 50 ->test_interfaces() |
| 53 ->TestRunner() | 51 ->TestRunner() |
| 54 ->DumpLayout(render_frame()->GetWebFrame()); | 52 ->DumpLayout(render_frame()->GetWebFrame()); |
| 55 Send(new ShellViewHostMsg_LayoutDumpResponse(routing_id(), dump)); | 53 Send(new ShellViewHostMsg_LayoutDumpResponse(routing_id(), dump)); |
| 56 } | 54 } |
| 57 | 55 |
| 58 void LayoutTestRenderFrameObserver::OnReplicateLayoutTestRuntimeFlagsChanges( | |
| 59 const base::DictionaryValue& changed_layout_test_runtime_flags) { | |
| 60 LayoutTestRenderProcessObserver::GetInstance() | |
| 61 ->test_interfaces() | |
| 62 ->TestRunner() | |
| 63 ->ReplicateLayoutTestRuntimeFlagsChanges( | |
| 64 changed_layout_test_runtime_flags); | |
| 65 } | |
| 66 | |
| 67 void LayoutTestRenderFrameObserver::OnReplicateTestConfiguration( | 56 void LayoutTestRenderFrameObserver::OnReplicateTestConfiguration( |
| 68 const ShellTestConfiguration& test_config, | 57 const ShellTestConfiguration& test_config) { |
| 69 const base::DictionaryValue& | |
| 70 accumulated_layout_test_runtime_flags_changes) { | |
| 71 BlinkTestRunner::Get(render_frame()->GetRenderView()) | 58 BlinkTestRunner::Get(render_frame()->GetRenderView()) |
| 72 ->OnReplicateTestConfiguration(test_config); | 59 ->OnReplicateTestConfiguration(test_config); |
| 73 | |
| 74 OnReplicateLayoutTestRuntimeFlagsChanges( | |
| 75 accumulated_layout_test_runtime_flags_changes); | |
| 76 } | 60 } |
| 77 | 61 |
| 78 void LayoutTestRenderFrameObserver::OnSetTestConfiguration( | 62 void LayoutTestRenderFrameObserver::OnSetTestConfiguration( |
| 79 const ShellTestConfiguration& test_config) { | 63 const ShellTestConfiguration& test_config) { |
| 80 BlinkTestRunner::Get(render_frame()->GetRenderView()) | 64 BlinkTestRunner::Get(render_frame()->GetRenderView()) |
| 81 ->OnSetTestConfiguration(test_config); | 65 ->OnSetTestConfiguration(test_config); |
| 82 } | 66 } |
| 83 | 67 |
| 84 void LayoutTestRenderFrameObserver::OnSetupSecondaryRenderer() { | 68 void LayoutTestRenderFrameObserver::OnSetupSecondaryRenderer() { |
| 85 BlinkTestRunner::Get(render_frame()->GetRenderView()) | 69 BlinkTestRunner::Get(render_frame()->GetRenderView()) |
| 86 ->OnSetupSecondaryRenderer(); | 70 ->OnSetupSecondaryRenderer(); |
| 87 } | 71 } |
| 88 | 72 |
| 89 } // namespace content | 73 } // namespace content |
| OLD | NEW |