Fix embedder test FPDFFormFillEmbedderTest.FormText for Skia. Skia uses different font face rendering methods compared to AGG, which leads to the text rendering discrepancy for Helvetica font in this test (See https://crbug.com/pdfium/1500#c7). Also, due to Skia uses premultiplied colors, the method to merge alpha channel and calculate the premultiplied color results in the final highlight color to be off by 1 digit compared to AGG's results (See https://crbug.com/pdfium/1515#c1). Since Skia's rendering results are acceptable and Skia is working as intended, this CL adds expected results for Skia to make this embedder test pass. Bug: pdfium:1500 Change-Id: I43d29253bc98f45e37e4071124fcd2f6036d64c7 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/68992 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Hui Yingst <nigi@chromium.org>
diff --git a/fpdfsdk/fpdf_formfill_embeddertest.cpp b/fpdfsdk/fpdf_formfill_embeddertest.cpp index e5ab09f..59928a9 100644 --- a/fpdfsdk/fpdf_formfill_embeddertest.cpp +++ b/fpdfsdk/fpdf_formfill_embeddertest.cpp
@@ -1238,13 +1238,12 @@ } #endif // PDF_ENABLE_V8 -// TODO(crbug.com/pdfium/11): Fix this test and enable. +TEST_F(FPDFFormFillEmbedderTest, FormText) { #if defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_) -#define MAYBE_FormText DISABLED_FormText + const char md5_1[] = "17efe329169f5b7681fbe939894a35de"; + const char md5_2[] = "42af2135e20deb09cbdbfb6418d86382"; + const char md5_3[] = "4a961599a512a08468b26b89d389c30a"; #else -#define MAYBE_FormText FormText -#endif -TEST_F(FPDFFormFillEmbedderTest, MAYBE_FormText) { #if defined(OS_MACOSX) const char md5_1[] = "d485541d958fef08d24e8eca3e537023"; const char md5_2[] = "c6e4a2fb10661116771ee74f54d9c5e0"; @@ -1258,6 +1257,7 @@ const char md5_2[] = "11487d5597599a26e8912b9c1d9422cb"; const char md5_3[] = "bffe0ecea9a533f217047ee41d6be466"; #endif +#endif // defined(_SKIA_SUPPORT_) || defined(_SKIA_SUPPORT_PATHS_) { EXPECT_TRUE(OpenDocument("text_form.pdf")); FPDF_PAGE page = LoadPage(0); @@ -3080,4 +3080,4 @@ ASSERT_FALSE(FORM_OnKeyUp(form_handle(), page(), FWL_VKEY_Return, modifier)); modifier |= FWL_EVENTFLAG_ControlKey; ASSERT_FALSE(FORM_OnKeyUp(form_handle(), page(), FWL_VKEY_Return, modifier)); -} \ No newline at end of file +}