Enable PDFiumPageThumbnailTest.GenerateThumbnail on macOS with ARM64
Add Skia expectations generated on macOS with ARM64 for test PDFiumPageThumbnailTest.GenerateThumbnail so that this test can be enabled. Bug: 1379872 Change-Id: Ibe876e741abd7b2d58990f0ffc7a7a813370eadd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4021767 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nigi <nigi@chromium.org> Cr-Commit-Position: refs/heads/main@{#1071440}


@ -847,15 +847,7 @@ class PDFiumPageThumbnailTest : public PDFiumTestBase {
|
||||
}
|
||||
};
|
||||
|
||||
// TODO(crbug.com/1379872): The thumbnails generated on macOS with ARM64 will
|
||||
// have small discrepancies due to floating point calculation. Need to add the
|
||||
// correct expectations for this test before re-enable it.
|
||||
#if BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)
|
||||
#define MAYBE_GenerateThumbnail DISABLED_GenerateThumbnail
|
||||
#else
|
||||
#define MAYBE_GenerateThumbnail GenerateThumbnail
|
||||
#endif
|
||||
TEST_P(PDFiumPageThumbnailTest, MAYBE_GenerateThumbnail) {
|
||||
TEST_P(PDFiumPageThumbnailTest, GenerateThumbnail) {
|
||||
TestClient client;
|
||||
std::unique_ptr<PDFiumEngine> engine =
|
||||
InitializeEngine(&client, FILE_PATH_LITERAL("variable_page_sizes.pdf"));
|
||||
@ -882,10 +874,15 @@ TEST_P(PDFiumPageThumbnailTest, MAYBE_GenerateThumbnail) {
|
||||
{6, 2, {46, 1399}}, // Super tall
|
||||
};
|
||||
|
||||
#if BUILDFLAG(IS_MAC) && defined(ARCH_CPU_ARM64)
|
||||
std::string file_name =
|
||||
GetParam() ? "variable_page_sizes_mac_arm64" : "variable_page_sizes";
|
||||
#else
|
||||
std::string file_name = "variable_page_sizes";
|
||||
#endif
|
||||
for (const auto& params : kGenerateThumbnailTestParams) {
|
||||
TestGenerateThumbnail(*engine, params.page_index, params.device_pixel_ratio,
|
||||
params.expected_thumbnail_size,
|
||||
"variable_page_sizes");
|
||||
params.expected_thumbnail_size, file_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
After ![]() (image error) Size: 350 B |
After ![]() (image error) Size: 355 B |
After ![]() (image error) Size: 285 B |
After ![]() (image error) Size: 396 B |
After ![]() (image error) Size: 407 B |
After ![]() (image error) Size: 385 B |
After ![]() (image error) Size: 448 B |
After ![]() (image error) Size: 524 B |
After ![]() (image error) Size: 511 B |
After ![]() (image error) Size: 523 B |
After ![]() (image error) Size: 459 B |
After ![]() (image error) Size: 498 B |
After ![]() (image error) Size: 385 B |
After ![]() (image error) Size: 448 B |
@ -10,3 +10,9 @@ is located in a directory corresponding to the device to pixel ratio. For
|
||||
example, the file located at `2.0x/variable_page_sizes_expected.pdf.3.png` is
|
||||
the thumbnail rendering of the fourth page of `variable_page_sizes.pdf` with a
|
||||
device to pixel ratio of 2.0.
|
||||
|
||||
Also some PNG file names contain extra renderer type and device information.
|
||||
For example, the file "variable_page_sizes_mac_arm64_expected_skia.pdf.3.png"
|
||||
is generated with Skia renderer on a macOS device with ARM64 CPU. If the
|
||||
renderer type and the device information are not included, by default the PNG
|
||||
files are generated with AGG renderer using a device with non-ARM64 CPU.
|
||||
|