| 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 // A POD-only struct with layout test runtime flags that have to be shared |
| 11 // across all renderers (testRunner javascript bindings that interact with these |
| 12 // flags are injected into all frames). |
| 13 // TODO(lukasza): Rename this to LayoutTestRuntimeFlags. |
| 10 struct LayoutDumpFlags { | 14 struct LayoutDumpFlags { |
| 11 LayoutDumpFlags(bool dump_as_text, | 15 // If true, the test_shell will generate pixel results in DumpAsText mode. |
| 12 bool dump_child_frames_as_text, | 16 volatile bool generate_pixel_results; |
| 13 bool dump_as_markup, | |
| 14 bool dump_child_frames_as_markup, | |
| 15 bool dump_child_frame_scroll_positions, | |
| 16 bool is_printing) | |
| 17 : dump_as_text(dump_as_text), | |
| 18 dump_child_frames_as_text(dump_child_frames_as_text), | |
| 19 dump_as_markup(dump_as_text), | |
| 20 dump_child_frames_as_markup(dump_child_frames_as_markup), | |
| 21 dump_child_frame_scroll_positions(dump_child_frame_scroll_positions), | |
| 22 is_printing(is_printing) {} | |
| 23 | |
| 24 // Default constructor needed for IPC. | |
| 25 // | |
| 26 // Default constructor is |= default| to make sure LayoutDumpFlags is a POD | |
| 27 // (required until we can remove content/shell/browser dependency on it). | |
| 28 LayoutDumpFlags() = default; | |
| 29 | 17 |
| 30 // If true, the test_shell will produce a plain text dump rather than a | 18 // If true, the test_shell will produce a plain text dump rather than a |
| 31 // text representation of the renderer. | 19 // text representation of the renderer. |
| 32 bool dump_as_text; | 20 volatile bool dump_as_text; |
| 33 | 21 |
| 34 // If true and if dump_as_text_ is true, the test_shell will recursively | 22 // If true and if dump_as_text_ is true, the test_shell will recursively |
| 35 // dump all frames as plain text. | 23 // dump all frames as plain text. |
| 36 bool dump_child_frames_as_text; | 24 volatile bool dump_child_frames_as_text; |
| 37 | 25 |
| 38 // If true, the test_shell will produce a dump of the DOM rather than a text | 26 // If true, the test_shell will produce a dump of the DOM rather than a text |
| 39 // representation of the layout objects. | 27 // representation of the layout objects. |
| 40 bool dump_as_markup; | 28 volatile bool dump_as_markup; |
| 41 | 29 |
| 42 // If true and if dump_as_markup_ is true, the test_shell will recursively | 30 // If true and if dump_as_markup_ is true, the test_shell will recursively |
| 43 // produce a dump of the DOM rather than a text representation of the | 31 // produce a dump of the DOM rather than a text representation of the |
| 44 // layout objects. | 32 // layout objects. |
| 45 bool dump_child_frames_as_markup; | 33 volatile bool dump_child_frames_as_markup; |
| 46 | 34 |
| 47 // If true, the test_shell will print out the child frame scroll offsets as | 35 // If true, the test_shell will print out the child frame scroll offsets as |
| 48 // well. | 36 // well. |
| 49 bool dump_child_frame_scroll_positions; | 37 volatile bool dump_child_frame_scroll_positions; |
| 50 | 38 |
| 51 // Reports whether recursing over child frames is necessary. | 39 // Reports whether recursing over child frames is necessary. |
| 52 bool dump_child_frames() const { | 40 bool dump_child_frames() const { |
| 53 if (dump_as_text) | 41 if (dump_as_text) |
| 54 return dump_child_frames_as_text; | 42 return dump_child_frames_as_text; |
| 55 else if (dump_as_markup) | 43 else if (dump_as_markup) |
| 56 return dump_child_frames_as_markup; | 44 return dump_child_frames_as_markup; |
| 57 else | 45 else |
| 58 return dump_child_frame_scroll_positions; | 46 return dump_child_frame_scroll_positions; |
| 59 } | 47 } |
| 60 | 48 |
| 61 // If true, layout is to target printed pages. | 49 // If true, layout is to target printed pages. |
| 62 bool is_printing; | 50 volatile bool is_printing; |
| 51 |
| 52 // If true, don't dump output until notifyDone is called. |
| 53 volatile bool wait_until_done; |
| 63 }; | 54 }; |
| 64 | 55 |
| 65 } // namespace test_runner | 56 } // namespace test_runner |
| 66 | 57 |
| 67 #endif // COMPONENTS_TEST_RUNNER_LAYOUT_DUMP_FLAGS_H_ | 58 #endif // COMPONENTS_TEST_RUNNER_LAYOUT_DUMP_FLAGS_H_ |
| OLD | NEW |