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/layout_dump.h" | 9 #include "components/test_runner/layout_dump.h" |
10 #include "components/test_runner/layout_dump_flags.h" | 10 #include "components/test_runner/layout_dump_flags.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 ->test_interfaces() | 27 ->test_interfaces() |
28 ->TestRunner() | 28 ->TestRunner() |
29 ->GetWebContentSettings()); | 29 ->GetWebContentSettings()); |
30 } | 30 } |
31 | 31 |
32 bool LayoutTestRenderFrameObserver::OnMessageReceived( | 32 bool LayoutTestRenderFrameObserver::OnMessageReceived( |
33 const IPC::Message& message) { | 33 const IPC::Message& message) { |
34 bool handled = true; | 34 bool handled = true; |
35 IPC_BEGIN_MESSAGE_MAP(LayoutTestRenderFrameObserver, message) | 35 IPC_BEGIN_MESSAGE_MAP(LayoutTestRenderFrameObserver, message) |
36 IPC_MESSAGE_HANDLER(ShellViewMsg_LayoutDumpRequest, OnLayoutDumpRequest) | 36 IPC_MESSAGE_HANDLER(ShellViewMsg_LayoutDumpRequest, OnLayoutDumpRequest) |
| 37 IPC_MESSAGE_HANDLER(ShellViewMsg_ReplicateLayoutDumpFlagsChanges, |
| 38 OnReplicateLayoutDumpFlagsChanges) |
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 const test_runner::LayoutDumpFlags& layout_dump_flags = |
| 51 LayoutTestRenderProcessObserver::GetInstance() |
| 52 ->test_interfaces() |
| 53 ->TestRunner() |
| 54 ->GetLayoutDumpFlags(); |
49 std::string dump = | 55 std::string dump = |
50 test_runner::DumpLayout(render_frame()->GetWebFrame(), layout_dump_flags); | 56 test_runner::DumpLayout(render_frame()->GetWebFrame(), layout_dump_flags); |
51 Send(new ShellViewHostMsg_LayoutDumpResponse(routing_id(), dump)); | 57 Send(new ShellViewHostMsg_LayoutDumpResponse(routing_id(), dump)); |
52 } | 58 } |
53 | 59 |
| 60 void LayoutTestRenderFrameObserver::OnReplicateLayoutDumpFlagsChanges( |
| 61 const base::DictionaryValue& changed_layout_dump_flags) { |
| 62 LayoutTestRenderProcessObserver::GetInstance() |
| 63 ->test_interfaces() |
| 64 ->TestRunner() |
| 65 ->ReplicateLayoutDumpFlagsChanges(changed_layout_dump_flags); |
| 66 } |
| 67 |
54 void LayoutTestRenderFrameObserver::OnReplicateTestConfiguration( | 68 void LayoutTestRenderFrameObserver::OnReplicateTestConfiguration( |
55 const ShellTestConfiguration& test_config) { | 69 const ShellTestConfiguration& test_config, |
| 70 const base::DictionaryValue& accumulated_layout_dump_flags_changes) { |
56 LayoutTestRenderProcessObserver::GetInstance() | 71 LayoutTestRenderProcessObserver::GetInstance() |
57 ->main_test_runner() | 72 ->main_test_runner() |
58 ->OnReplicateTestConfiguration(test_config); | 73 ->OnReplicateTestConfiguration(test_config); |
| 74 |
| 75 OnReplicateLayoutDumpFlagsChanges(accumulated_layout_dump_flags_changes); |
59 } | 76 } |
60 | 77 |
61 void LayoutTestRenderFrameObserver::OnSetTestConfiguration( | 78 void LayoutTestRenderFrameObserver::OnSetTestConfiguration( |
62 const ShellTestConfiguration& test_config) { | 79 const ShellTestConfiguration& test_config) { |
63 LayoutTestRenderProcessObserver::GetInstance() | 80 LayoutTestRenderProcessObserver::GetInstance() |
64 ->main_test_runner() | 81 ->main_test_runner() |
65 ->OnSetTestConfiguration(test_config); | 82 ->OnSetTestConfiguration(test_config); |
66 } | 83 } |
67 | 84 |
68 } // namespace content | 85 } // namespace content |
OLD | NEW |