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

Unified Diff: content/shell/renderer/test_runner/web_test_proxy.cc

Issue 919273002: Revert of Revert of Add test_runner hook to dump drag image. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch in fix from https://codereview.chromium.org/918313003/ Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/renderer/test_runner/web_test_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/test_runner/web_test_proxy.cc
diff --git a/content/shell/renderer/test_runner/web_test_proxy.cc b/content/shell/renderer/test_runner/web_test_proxy.cc
index da62fc05f003e2c24df25866a0e3c31f7676eddf..13ee5027c7e3d4feb4a14b3b8098cc5e70941fd5 100644
--- a/content/shell/renderer/test_runner/web_test_proxy.cc
+++ b/content/shell/renderer/test_runner/web_test_proxy.cc
@@ -375,6 +375,7 @@ blink::WebView* WebTestProxyBase::GetWebView() const {
}
void WebTestProxyBase::Reset() {
+ drag_image_.reset();
animate_scheduled_ = false;
resource_identifier_map_.clear();
log_console_output_ = true;
@@ -565,6 +566,11 @@ void WebTestProxyBase::CapturePixelsAsync(
TRACE_EVENT0("shell", "WebTestProxyBase::CapturePixelsAsync");
DCHECK(!callback.is_null());
+ if (!drag_image_.isNull()) {
+ callback.Run(drag_image_.getSkBitmap());
+ return;
+ }
+
if (test_interfaces_->GetTestRunner()->isPrinting()) {
base::MessageLoopProxy::current()->PostTask(
FROM_HERE,
@@ -806,6 +812,10 @@ void WebTestProxyBase::StartDragging(blink::WebLocalFrame* frame,
blink::WebDragOperationsMask mask,
const blink::WebImage& image,
const blink::WebPoint& point) {
+ if (test_interfaces_->GetTestRunner()->shouldDumpDragImage()) {
+ if (drag_image_.isNull())
+ drag_image_ = image;
+ }
// When running a test, we need to fake a drag drop operation otherwise
// Windows waits for real mouse events to know when the drag is over.
test_interfaces_->GetEventSender()->DoDragDrop(data, mask);
« no previous file with comments | « content/shell/renderer/test_runner/web_test_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698