Remove duplication between TestRunner's fields and LayoutDumpFlags struct.
The current CL paves the way for 1) moving more test flags from
TestRunner's fields into LayoutDumpFlags and 2) replicating the
test flags when transferring to another renderer process (in addition
to using LayoutDumpFlags during a textual layout dump).
In a way, the current CL backpedals on some aspects of an earlier CL
(crrev.com/1589643003) which has introduced LayoutDumpFlags struct that
holds layout dump flags for the purpose of passing them to the browser
process (which can coordinate dumping across all frames). The
backpedaling is necessary because:
- Having LayoutDumpFlags is good for passing the flags to the browser
process (when having to do a layout dump spanning multiple renderers /
OOPIFs), but LayoutDumpFlags is also bad, because the same flags are
represented (in a slightly different way) in 2 places: in
LayoutDumpFlags struct and in TestRunner fields. This CL fixes this
by moving relevant fields of TestRunner into LayoutDumpFlags struct.
- The previous CL tried to be (unnecessarily :-/) smart and for example:
- consolidated |dump_child_frames_as_text|,
|dump_child_frames_as_markup| and |dump_child_frame_scroll_positions|
into |dump_child_frames| field.
- consolidated |dump_as_text|, |dump_as_markup| into a |main_dump_mode|
field with 3 possible states - text / markup / scroll positions.
The current CL backpedals on this and simply copies TestRunner's fields
into LayoutDumpFlags, because otherwise preserving all existing test
behavior is prooving to be really difficult.
BUG=587175
Review URL: https://codereview.chromium.org/1689283003
Cr-Commit-Position: refs/heads/master@{#377712}
diff --git a/components/test_runner/test_runner.h b/components/test_runner/test_runner.h
index cd9e9ae..00b7488f 100644
--- a/components/test_runner/test_runner.h
+++ b/components/test_runner/test_runner.h
@@ -15,6 +15,7 @@
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "components/test_runner/layout_dump_flags.h"
#include "components/test_runner/test_runner_export.h"
#include "components/test_runner/web_task.h"
#include "components/test_runner/web_test_runner.h"
@@ -72,7 +73,7 @@
bool ShouldStayOnPageAfterHandlingBeforeUnload() const override;
bool ShouldDumpAsAudio() const override;
void GetAudioData(std::vector<unsigned char>* buffer_view) const override;
- LayoutDumpFlags GetLayoutDumpFlags() override;
+ const LayoutDumpFlags& GetLayoutDumpFlags() override;
bool HasCustomTextDump(std::string* custom_text_dump) const override;
bool ShouldDumpBackForwardList() const override;
blink::WebContentSettingsClient* GetWebContentSettings() const override;
@@ -80,14 +81,9 @@
// Methods used by WebTestProxyBase.
bool shouldDumpSelectionRect() const;
bool isPrinting() const;
- bool shouldDumpAsText();
bool shouldDumpAsTextWithPixelResults();
bool shouldDumpAsCustomText() const;
std:: string customDumpText() const;
- bool shouldDumpAsMarkup();
- bool shouldDumpChildFrameScrollPositions() const;
- bool shouldDumpChildFramesAsMarkup() const;
- bool shouldDumpChildFramesAsText() const;
void ShowDevTools(const std::string& settings,
const std::string& frontend_url);
void ClearDevToolsLocalStorage();
@@ -709,26 +705,8 @@
// If true, the test_shell will generate pixel results in DumpAsText mode
bool generate_pixel_results_;
- // If true, the test_shell will produce a plain text dump rather than a
- // text representation of the renderer.
- bool dump_as_text_;
-
- // If true and if dump_as_text_ is true, the test_shell will recursively
- // dump all frames as plain text.
- bool dump_child_frames_as_text_;
-
- // If true, the test_shell will produce a dump of the DOM rather than a text
- // representation of the renderer.
- bool dump_as_markup_;
-
- // If true and if dump_as_markup_ is true, the test_shell will recursively
- // produce a dump of the DOM rather than a text representation of the
- // renderer.
- bool dump_child_frames_as_markup_;
-
- // If true, the test_shell will print out the child frame scroll offsets as
- // well.
- bool dump_child_frame_scroll_positions_;
+ // Flags controlling what content gets dumped as a layout text result.
+ LayoutDumpFlags layout_dump_flags_;
// If true, the test_shell will print out the icon change notifications.
bool dump_icon_changes_;
@@ -802,9 +780,6 @@
// a series of 1px-wide, view-tall paints across the width of the view.
bool sweep_horizontally_;
- // If true, layout is to target printed pages.
- bool is_printing_;
-
// If false, MockWebMIDIAccessor fails on startSession() for testing.
bool midi_accessor_result_;