Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side Diff: components/test_runner/layout_dump_flags.h

Issue 1689283003: Remove duplication between TestRunner's fields and LayoutDumpFlags struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Despite LayoutDumpFlags constructor, we still need to set the flags in TestRunner::Reset. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/test_runner/layout_dump.cc ('k') | components/test_runner/test_runner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_
OLDNEW
« no previous file with comments | « components/test_runner/layout_dump.cc ('k') | components/test_runner/test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698