Add test_runner hook to dump drag image.
This is a second attempt at:
https://codereview.chromium.org/904833004/
which caused flakiness in pixel tests and was reverted here:
https://codereview.chromium.org/919273002/
This CL merges the fix from:
https://codereview.chromium.org/918313003/
It also handles the case where dumpDragImage is called but no drag occurs
by dumping a 1x1 empty transparent image.
This is used by:
https://codereview.chromium.org/886323005/
BUG=451759, 458077
Review URL: https://codereview.chromium.org/916893003
Cr-Commit-Position: refs/heads/master@{#316194}
diff --git a/content/shell/renderer/test_runner/test_runner.h b/content/shell/renderer/test_runner/test_runner.h
index ffb6bf0a..0a6e704b 100644
--- a/content/shell/renderer/test_runner/test_runner.h
+++ b/content/shell/renderer/test_runner/test_runner.h
@@ -119,6 +119,7 @@
void RequestPointerUnlock();
bool isPointerLocked();
void setToolTipText(const blink::WebString&);
+ bool shouldDumpDragImage();
bool midiAccessorResult();
@@ -469,6 +470,12 @@
// WebFrameClient receives a loadURLExternally() call.
void WaitUntilExternalURLLoad();
+ // This function sets a flag which tells the WebTestProxy to dump the drag
+ // image when the next drag-and-drop is initiated. It is equivalent to
+ // DumpAsTextWithPixelResults but the pixel results will be the drag image
+ // instead of a snapshot of the page.
+ void DumpDragImage();
+
///////////////////////////////////////////////////////////////////////////
// Methods interacting with the WebTestProxy
@@ -739,6 +746,9 @@
// taking possible transforms of the selection rect into account.
bool dump_selection_rect_;
+ // If true, the test_shell will dump the drag image as pixel results.
+ bool dump_drag_image_;
+
// If true, pixel dump will be produced as a series of 1px-tall, view-wide
// individual paints over the height of the view.
bool test_repaint_;