#include "pdf/pdfium/pdfium_print.h"
#include <memory>
#include <optional>
#include <string_view>
#include "base/files/file_path.h"
#include "base/strings/stringprintf.h"
#include "pdf/pdfium/pdfium_engine.h"
#include "pdf/pdfium/pdfium_engine_exports.h"
#include "pdf/pdfium/pdfium_test_base.h"
#include "pdf/test/test_client.h"
#include "pdf/test/test_helpers.h"
#include "printing/pdf_render_settings.h"
#include "printing/units.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/web/web_print_params.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size_f.h"
#include "ui/gfx/geometry/skia_conversions.h"
namespace chrome_pdf {
PDFiumPrintTest;
ElementsAre;
namespace {
constexpr gfx::SizeF kUSLetterSize = …;
constexpr gfx::RectF kUSLetterRect = …;
constexpr gfx::RectF kPrintableAreaRect = …;
ExpectedDimensions;
std::string GenerateRendererSpecificFileName(const std::string& file_name,
bool use_skia_renderer) { … }
base::FilePath GetReferenceFilePath(std::string_view test_filename) { … }
blink::WebPrintParams GetDefaultPrintParams() { … }
void CheckPdfDimensions(const std::vector<uint8_t>& pdf_data,
const ExpectedDimensions& expected_dimensions) { … }
void CheckPdfRendering(const std::vector<uint8_t>& pdf_data,
int page_number,
const gfx::SizeF& size_in_points,
std::string_view expected_png_filename) { … }
}
TEST_P(PDFiumPrintTest, Basic) { … }
TEST_P(PDFiumPrintTest, AlterScalingDefault) { … }
TEST_P(PDFiumPrintTest, AlterScalingFitPaper) { … }
TEST_P(PDFiumPrintTest, AlterScalingFitPrintable) { … }
INSTANTIATE_TEST_SUITE_P(…);
}