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

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

Issue 386803003: Be robust to printing too large pages in tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | 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 0342bdd637a5d5e851793659cbe715e8d55a3099..1d107898f9efb5ae0b5bb9cec874507f20ec27f4 100644
--- a/content/shell/renderer/test_runner/web_test_proxy.cc
+++ b/content/shell/renderer/test_runner/web_test_proxy.cc
@@ -478,8 +478,11 @@ void WebTestProxyBase::CapturePixelsForPrinting(
bool is_opaque = false;
skia::RefPtr<SkCanvas> canvas(skia::AdoptRef(skia::TryCreateBitmapCanvas(
page_size_in_pixels.width, totalHeight, is_opaque)));
- if (canvas)
- web_frame->printPagesWithBoundaries(canvas.get(), page_size_in_pixels);
+ if (!canvas) {
+ callback.Run(SkBitmap());
+ return;
+ }
+ web_frame->printPagesWithBoundaries(canvas.get(), page_size_in_pixels);
web_frame->printEnd();
DrawSelectionRect(canvas.get());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698