diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-10-18 12:17:14 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-18 17:19:26 +0000 |
commit | 04e4dc88da34c323e7a16586bddf377a610d63c5 (patch) | |
tree | 3edad973a50e8a24aed47a4aa6ab6e267720876a /fpdfsdk/fpdfedit_embeddertest.cpp | |
parent | 854d71c1420eb80ec79755a6cdf829f3f39aead7 (diff) | |
download | pdfium-04e4dc88da34c323e7a16586bddf377a610d63c5.tar.xz |
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 <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfedit_embeddertest.cpp')
-rw-r--r-- | fpdfsdk/fpdfedit_embeddertest.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp index 74e85f6795..60db27ad0c 100644 --- a/fpdfsdk/fpdfedit_embeddertest.cpp +++ b/fpdfsdk/fpdfedit_embeddertest.cpp @@ -223,7 +223,7 @@ TEST_F(FPDFEditEmbeddertest, RasterizePDF) { // Get the generated content. Make sure it is at least as big as the original // PDF. EXPECT_GT(GetString().size(), 923U); - TestAndCloseSaved(612, 792, kAllBlackMd5sum); + VerifySavedDocument(612, 792, kAllBlackMd5sum); } TEST_F(FPDFEditEmbeddertest, AddPaths) { @@ -366,7 +366,7 @@ TEST_F(FPDFEditEmbeddertest, AddPaths) { FPDF_ClosePage(page); // Render the saved result - TestAndCloseSaved(612, 792, last_md5); + VerifySavedDocument(612, 792, last_md5); } TEST_F(FPDFEditEmbeddertest, PathsPoints) { @@ -456,8 +456,9 @@ TEST_F(FPDFEditEmbeddertest, EditOverExistingContent) { EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0)); UnloadPage(page); - // Render the saved result without closing the page and document - TestSaved(612, 792, "ad04e5bd0f471a9a564fb034bd0fb073"); + OpenSavedDocument(); + LoadSavedPage(); + VerifySavedRendering(612, 792, "ad04e5bd0f471a9a564fb034bd0fb073"); ClearString(); // Add another opaque rectangle on top of the existing content @@ -479,10 +480,12 @@ TEST_F(FPDFEditEmbeddertest, EditOverExistingContent) { // Now save the result, closing the page and document EXPECT_TRUE(FPDF_SaveAsCopy(m_SavedDocument, this, 0)); - CloseSaved(); + + CloseSavedPage(); + CloseSavedDocument(); // Render the saved result - TestAndCloseSaved(612, 792, last_md5); + VerifySavedDocument(612, 792, last_md5); } TEST_F(FPDFEditEmbeddertest, AddStrokedPaths) { @@ -915,7 +918,8 @@ TEST_F(FPDFEditEmbeddertest, AddTrueTypeFontText) { EXPECT_TRUE(FPDFPage_GenerateContent(page)); EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0)); FPDF_ClosePage(page); - TestAndCloseSaved(612, 792, md5_2); + + VerifySavedDocument(612, 792, md5_2); } TEST_F(FPDFEditEmbeddertest, TransformAnnot) { @@ -989,7 +993,8 @@ TEST_F(FPDFEditEmbeddertest, AddCIDFontText) { EXPECT_TRUE(FPDFPage_GenerateContent(page)); EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0)); FPDF_ClosePage(page); - TestAndCloseSaved(612, 792, md5); + + VerifySavedDocument(612, 792, md5); } #endif // _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ @@ -1021,7 +1026,8 @@ TEST_F(FPDFEditEmbeddertest, SaveAndRender) { EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0)); UnloadPage(page); } - TestAndCloseSaved(612, 792, md5); + + VerifySavedDocument(612, 792, md5); } TEST_F(FPDFEditEmbeddertest, ExtractImageBitmap) { |