From 04e4dc88da34c323e7a16586bddf377a610d63c5 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 18 Oct 2017 12:17:14 -0400 Subject: Fix rounding of colour values This CL fixes rounding issues with the colour values when written then read from path objects. Bug: pdfium:919 Change-Id: I8ab33706f1c7d81c3ec755706b1a613cf2a557b3 Reviewed-on: https://pdfium-review.googlesource.com/16270 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp') diff --git a/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp b/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp index 91346dae2a..3770e98d86 100644 --- a/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp +++ b/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp @@ -73,14 +73,20 @@ TEST_F(CPDFSecurityHandlerEmbeddertest, PasswordAfterGenerateSave) { file_access.m_GetBlock = GetBlockFromString; file_access.m_Param = &new_file; EXPECT_FALSE(FPDF_LoadCustomDocument(&file_access, nullptr)); + struct { const char* password; const unsigned long permissions; } tests[] = {{"1234", 0xFFFFF2C0}, {"5678", 0xFFFFFFFC}}; + for (const auto& test : tests) { - TestSaved(612, 792, md5, test.password); + OpenSavedDocument(test.password); + LoadSavedPage(); + VerifySavedRendering(612, 792, md5); EXPECT_EQ(test.permissions, FPDF_GetDocPermissions(m_SavedDocument)); - CloseSaved(); + + CloseSavedPage(); + CloseSavedDocument(); } } -- cgit v1.2.3