Chromium Code Reviews| 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..cbcaa95030f70178e87cc616f73f35af757cda9b 100644 |
| --- a/content/shell/renderer/test_runner/web_test_proxy.cc |
| +++ b/content/shell/renderer/test_runner/web_test_proxy.cc |
| @@ -6,6 +6,7 @@ |
| #include <cctype> |
| +#include "base/base64.h" |
| #include "base/callback_helpers.h" |
| #include "base/command_line.h" |
| #include "base/logging.h" |
| @@ -806,6 +807,15 @@ void WebTestProxyBase::StartDragging(blink::WebLocalFrame* frame, |
| blink::WebDragOperationsMask mask, |
| const blink::WebImage& image, |
| const blink::WebPoint& point) { |
| + if (test_interfaces_->GetTestRunner()->shouldDumpDragImage()) { |
| + const SkBitmap bitmap = image.getSkBitmap(); |
| + SkAutoLockPixels lock(bitmap); |
| + std::string encoded; |
| + base::Base64Encode(base::StringPiece(static_cast<char*>(bitmap.getPixels()), |
|
jackhou1
2015/02/10 01:54:20
Is there a better way to represent the image? This
Justin Novosad
2015/02/10 22:37:48
Yeah this is not ideal. It would be much better to
jackhou1
2015/02/11 00:08:24
Just one. And I imagine that would be fine for any
|
| + bitmap.getSize()), |
| + &encoded); |
| + delegate_->PrintMessage(std::string("DragImage: ") + encoded + "\n"); |
| + } |
| // 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); |