0
Files
src/pdf
Lei Zhang 09fbb9d0bc Add a test for PDF text selection rendering
Add PDFiumEngineTest.DrawTextSelectionsHelloWorld to render the blue
text selection on hello_world2.pdf with various selection ranges, sans
the text. The test renders the selection as in-memory bitmaps, and
compares them against expectations which are stored as PNGs.

Rendering only the selection is easier than rendering the PDF in its
entirety using PDFiumEngine. The out is also simpler too, but still
not consistent across platforms, since text rendering varies, so the
text bounding boxes are different. To draw only the selections, the test
has to reach into PDFiumEngine internals. To make this easier without
adding a lot of non-trivial "for testing" code to PDFiumEngine itself,
make PDFiumEngineTest a friend of PDFiumEngine.

This creates a baseline to check how PDF text selection works, and adds
missing test coverage. This is in preparation for improving PDF text
selection, as it oftentimes appear uneven.

Bug: 40448046
Change-Id: I37640f39aaa29ee693647b23f825a942ceb497b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5892210
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1360737}
2024-09-26 20:00:54 +00:00
..
2024-09-18 14:23:33 +00:00

//pdf contains the PDF plugin, its Blink-based replacement, as well as PDF utility functions that leverage PDFium. It can use low-level components that live below the content layer, as well as other foundational code like //printing. It should not use //content or anything in //components that lives above the content layer. Code that lives above the content layer should live in //components/pdf, or in the embedder. All the code here should run in sandboxed child processes.

TODO(crbug.com/40186598): Remove existing //content dependencies.