OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef COMPONENTS_TEST_RUNNER_LAYOUT_DUMP_FLAGS_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_LAYOUT_DUMP_FLAGS_H_ |
6 #define COMPONENTS_TEST_RUNNER_LAYOUT_DUMP_FLAGS_H_ | 6 #define COMPONENTS_TEST_RUNNER_LAYOUT_DUMP_FLAGS_H_ |
7 | 7 |
8 namespace test_runner { | 8 namespace test_runner { |
9 | 9 |
10 enum class LayoutDumpMode { | 10 struct LayoutDumpFlags { |
11 DUMP_AS_TEXT, | 11 LayoutDumpFlags(bool dump_as_text, |
12 DUMP_AS_MARKUP, | 12 bool dump_child_frames_as_text, |
13 DUMP_SCROLL_POSITIONS | 13 bool dump_as_markup, |
14 }; | 14 bool dump_child_frames_as_markup, |
| 15 bool dump_child_frame_scroll_positions, |
| 16 bool is_printing, |
| 17 bool dump_line_box_trees, |
| 18 bool debug_render_tree) |
| 19 : dump_as_text(dump_as_text), |
| 20 dump_child_frames_as_text(dump_child_frames_as_text), |
| 21 dump_as_markup(dump_as_text), |
| 22 dump_child_frames_as_markup(dump_child_frames_as_markup), |
| 23 dump_child_frame_scroll_positions(dump_child_frame_scroll_positions), |
| 24 is_printing(is_printing), |
| 25 dump_line_box_trees(dump_line_box_trees), |
| 26 debug_render_tree(debug_render_tree) {} |
15 | 27 |
16 struct LayoutDumpFlags { | 28 // Default constructor needed for IPC. |
17 LayoutDumpMode main_dump_mode; | 29 // |
| 30 // Default constructor is |= default| to make sure LayoutDumpFlags is a POD |
| 31 // (required until we can remove content/shell/browser dependency on it). |
| 32 LayoutDumpFlags() = default; |
18 | 33 |
19 bool dump_as_printed; | 34 // If true, the test_shell will produce a plain text dump rather than a |
20 bool dump_child_frames; | 35 // text representation of the renderer. |
| 36 bool dump_as_text; |
| 37 |
| 38 // If true and if dump_as_text_ is true, the test_shell will recursively |
| 39 // dump all frames as plain text. |
| 40 bool dump_child_frames_as_text; |
| 41 |
| 42 // If true, the test_shell will produce a dump of the DOM rather than a text |
| 43 // representation of the layout objects. |
| 44 bool dump_as_markup; |
| 45 |
| 46 // If true and if dump_as_markup_ is true, the test_shell will recursively |
| 47 // produce a dump of the DOM rather than a text representation of the |
| 48 // layout objects. |
| 49 bool dump_child_frames_as_markup; |
| 50 |
| 51 // If true, the test_shell will print out the child frame scroll offsets as |
| 52 // well. |
| 53 bool dump_child_frame_scroll_positions; |
| 54 |
| 55 // Reports whether recursing over child frames is necessary. |
| 56 bool dump_child_frames() const { |
| 57 if (dump_as_text) |
| 58 return dump_child_frames_as_text; |
| 59 else if (dump_as_markup) |
| 60 return dump_child_frames_as_markup; |
| 61 else |
| 62 return dump_child_frame_scroll_positions; |
| 63 } |
| 64 |
| 65 // If true, layout is to target printed pages. |
| 66 bool is_printing; |
| 67 |
| 68 // Extra flags for debugging layout tests. |
21 bool dump_line_box_trees; | 69 bool dump_line_box_trees; |
22 bool debug_render_tree; | 70 bool debug_render_tree; |
23 }; | 71 }; |
24 | 72 |
25 } // namespace test_runner | 73 } // namespace test_runner |
26 | 74 |
27 #endif // COMPONENTS_TEST_RUNNER_LAYOUT_DUMP_FLAGS_H_ | 75 #endif // COMPONENTS_TEST_RUNNER_LAYOUT_DUMP_FLAGS_H_ |
OLD | NEW |