Index: content/shell/test_runner/test_runner.cc |
diff --git a/content/shell/test_runner/test_runner.cc b/content/shell/test_runner/test_runner.cc |
index 3bc41601423a83f99936f8e62ed9d23a4236ca6b..f744f6135adf633b0c35be95926766711945b0e5 100644 |
--- a/content/shell/test_runner/test_runner.cc |
+++ b/content/shell/test_runner/test_runner.cc |
@@ -1768,8 +1768,8 @@ std::string TestRunner::DumpLayout(blink::WebLocalFrame* frame) { |
} |
void TestRunner::DumpPixelsAsync( |
- blink::WebView* web_view, |
- const base::Callback<void(const SkBitmap&)>& callback) { |
+ blink::WebLocalFrame* frame, |
+ base::OnceCallback<void(const SkBitmap&)> callback) { |
if (layout_test_runtime_flags_.dump_drag_image()) { |
if (drag_image_.IsNull()) { |
// This means the test called dumpDragImage but did not initiate a drag. |
@@ -1777,16 +1777,28 @@ void TestRunner::DumpPixelsAsync( |
SkBitmap bitmap; |
bitmap.allocN32Pixels(1, 1); |
bitmap.eraseColor(0); |
- callback.Run(bitmap); |
+ std::move(callback).Run(bitmap); |
return; |
} |
- callback.Run(drag_image_.GetSkBitmap()); |
+ std::move(callback).Run(drag_image_.GetSkBitmap()); |
return; |
} |
- test_runner::DumpPixelsAsync(web_view, layout_test_runtime_flags_, |
- delegate_->GetDeviceScaleFactor(), callback); |
+ // See if we need to draw the selection bounds rect on top of the snapshot. |
+ if (layout_test_runtime_flags_.dump_selection_rect()) { |
alexmos
2017/07/11 15:01:07
nit: { not needed
Łukasz Anforowicz
2017/07/11 16:30:24
After renaming the function to CreateSelectionBoun
alexmos
2017/07/11 16:48:10
Acknowledged.
|
+ callback = CreateSelectionDrawingCallback(frame, std::move(callback)); |
+ } |
+ |
+ // Request appropriate kind of pixel dump. |
+ if (layout_test_runtime_flags_.is_printing()) { |
+ test_runner::PrintFrameAsync(frame, std::move(callback)); |
+ } else { |
+ // TODO(lukasza): Ask the |delegate_| to capture the pixels in the browser |
+ // process, so that OOPIF pixels are also captured. |
+ test_runner::DumpPixelsAsync(frame, delegate_->GetDeviceScaleFactor(), |
+ std::move(callback)); |
+ } |
} |
void TestRunner::ReplicateLayoutTestRuntimeFlagsChanges( |