Skip to content

Commit

Permalink
Enable PDFiumPageThumbnailTest.GenerateThumbnail on macOS with ARM64
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
Hui Yingst authored and Chromium LUCI CQ committed Nov 15, 2022
1 parent 2a59a8a commit f9ddedc
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 11 deletions.
19 changes: 8 additions & 11 deletions pdf/pdfium/pdfium_page_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -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);
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions pdf/test/data/thumbnail/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit f9ddedc

Please sign in to comment.