0

Add non-empty PDF paper size for TestPrintingContext

Updating printing browser tests to use test context instead of platform
implementations will result in this method getting used.  Fill in with
the values for a real paper size; choose A4 as an alternative to Letter
which is a fallback default for multiple platforms.

Bug: 1283182
Change-Id: Ifc4316f9bc1535386b4d507ea3d4ae2852abad25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3668938
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1007983}
This commit is contained in:
Alan Screen
2022-05-26 21:02:16 +00:00
committed by Chromium LUCI CQ
parent 31cbb5c7e8
commit ce366acca0

@ -17,6 +17,7 @@
#include "printing/mojom/print.mojom.h"
#include "printing/print_settings.h"
#include "printing/printing_context.h"
#include "printing/units.h"
#include "ui/gfx/geometry/size.h"
#if BUILDFLAG(IS_WIN)
@ -103,8 +104,11 @@ mojom::ResultCode TestPrintingContext::UseDefaultSettings() {
}
gfx::Size TestPrintingContext::GetPdfPaperSizeDeviceUnits() {
NOTIMPLEMENTED();
return gfx::Size();
// Default to A4 paper size, which is an alternative to Letter size that is
// often used as the fallback size for some platform-specific
// implementations.
return gfx::Size(kA4WidthInch * settings_->device_units_per_inch(),
kA4HeightInch * settings_->device_units_per_inch());
}
mojom::ResultCode TestPrintingContext::UpdatePrinterSettings(