diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2017-11-10 20:27:23 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-10 20:27:23 +0000 |
commit | 8baea3c694900581fef42ee64795aa5307c6373d (patch) | |
tree | 12f1a4415b4bc4906b1faa06efeba5fe72753a45 /fpdfsdk | |
parent | 267d2a862fd9ec7bc722533914e8e5af8a19df26 (diff) | |
download | pdfium-chromium/3265.tar.xz |
Stop using m_SavedPage in embedder tests.chromium/3265
Change-Id: Id53f57085fecfe331c8cbfa6bb372b5ea5044442
Reviewed-on: https://pdfium-review.googlesource.com/18332
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/fpdfannot_embeddertest.cpp | 28 | ||||
-rw-r--r-- | fpdfsdk/fpdfedit_embeddertest.cpp | 14 | ||||
-rw-r--r-- | fpdfsdk/fpdfeditpath_embeddertest.cpp | 4 |
3 files changed, 23 insertions, 23 deletions
diff --git a/fpdfsdk/fpdfannot_embeddertest.cpp b/fpdfsdk/fpdfannot_embeddertest.cpp index c49e77bc2b..dce658201c 100644 --- a/fpdfsdk/fpdfannot_embeddertest.cpp +++ b/fpdfsdk/fpdfannot_embeddertest.cpp @@ -286,15 +286,15 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndSaveUnderlineAnnotation) { const char md5[] = "dba153419f67b7c0c0e3d22d3e8910d5"; OpenSavedDocument(); - LoadSavedPage(); - VerifySavedRendering(612, 792, md5); + page = LoadSavedPage(0); + VerifySavedRendering(page, 612, 792, md5); // Check that the saved document has 2 annotations on the first page - EXPECT_EQ(2, FPDFPage_GetAnnotCount(m_SavedPage)); + EXPECT_EQ(2, FPDFPage_GetAnnotCount(page)); // Check that the second annotation is an underline annotation and verify // its quadpoints. - FPDF_ANNOTATION new_annot = FPDFPage_GetAnnot(m_SavedPage, 1); + FPDF_ANNOTATION new_annot = FPDFPage_GetAnnot(page, 1); ASSERT_TRUE(new_annot); EXPECT_EQ(FPDF_ANNOT_UNDERLINE, FPDFAnnot_GetSubtype(new_annot)); FS_QUADPOINTSF new_quadpoints; @@ -306,7 +306,7 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndSaveUnderlineAnnotation) { FPDFPage_CloseAnnot(new_annot); - CloseSavedPage(); + CloseSavedPage(page); CloseSavedDocument(); } @@ -591,12 +591,12 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndModifyPath) { // Open the saved document. OpenSavedDocument(); - LoadSavedPage(); - VerifySavedRendering(595, 842, md5_new_annot); + page = LoadSavedPage(0); + VerifySavedRendering(page, 595, 842, md5_new_annot); // Check that the document has a correct count of annotations and objects. - EXPECT_EQ(3, FPDFPage_GetAnnotCount(m_SavedPage)); - annot = FPDFPage_GetAnnot(m_SavedPage, 2); + EXPECT_EQ(3, FPDFPage_GetAnnotCount(page)); + annot = FPDFPage_GetAnnot(page, 2); ASSERT_TRUE(annot); EXPECT_EQ(1, FPDFAnnot_GetObjectCount(annot)); @@ -608,7 +608,7 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndModifyPath) { EXPECT_EQ(rect.top, new_rect.top); FPDFPage_CloseAnnot(annot); - CloseSavedPage(); + CloseSavedPage(page); CloseSavedDocument(); } @@ -870,9 +870,9 @@ TEST_F(FPDFAnnotEmbeddertest, GetSetStringValue) { const char md5[] = "c96ee1f316d7f5a1b154de9f9d467f01"; #endif OpenSavedDocument(); - LoadSavedPage(); - VerifySavedRendering(595, 842, md5); - FPDF_ANNOTATION new_annot = FPDFPage_GetAnnot(m_SavedPage, 0); + page = LoadSavedPage(0); + VerifySavedRendering(page, 595, 842, md5); + FPDF_ANNOTATION new_annot = FPDFPage_GetAnnot(page, 0); // Check that the string value of the modified date is the newly-set value. EXPECT_EQ(FPDF_OBJECT_STRING, FPDFAnnot_GetValueType(new_annot, kDateKey)); @@ -886,7 +886,7 @@ TEST_F(FPDFAnnotEmbeddertest, GetSetStringValue) { .c_str()); FPDFPage_CloseAnnot(new_annot); - CloseSavedPage(); + CloseSavedPage(page); CloseSavedDocument(); } diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp index f1f02ffa6d..6cb2771154 100644 --- a/fpdfsdk/fpdfedit_embeddertest.cpp +++ b/fpdfsdk/fpdfedit_embeddertest.cpp @@ -457,31 +457,31 @@ TEST_F(FPDFEditEmbeddertest, EditOverExistingContent) { UnloadPage(page); OpenSavedDocument(); - LoadSavedPage(); - VerifySavedRendering(612, 792, "ad04e5bd0f471a9a564fb034bd0fb073"); + page = LoadSavedPage(0); + VerifySavedRendering(page, 612, 792, "ad04e5bd0f471a9a564fb034bd0fb073"); ClearString(); // Add another opaque rectangle on top of the existing content FPDF_PAGEOBJECT green_rect = FPDFPageObj_CreateNewRect(150, 700, 25, 50); EXPECT_TRUE(FPDFPath_SetFillColor(green_rect, 0, 255, 0, 255)); EXPECT_TRUE(FPDFPath_SetDrawMode(green_rect, FPDF_FILLMODE_ALTERNATE, 0)); - FPDFPage_InsertObject(m_SavedPage, green_rect); + FPDFPage_InsertObject(page, green_rect); // Add another transparent rectangle on top of existing content FPDF_PAGEOBJECT green_rect2 = FPDFPageObj_CreateNewRect(175, 700, 25, 50); EXPECT_TRUE(FPDFPath_SetFillColor(green_rect2, 0, 255, 0, 100)); EXPECT_TRUE(FPDFPath_SetDrawMode(green_rect2, FPDF_FILLMODE_ALTERNATE, 0)); - FPDFPage_InsertObject(m_SavedPage, green_rect2); - FPDF_BITMAP new_bitmap = RenderPageWithFlags(m_SavedPage, m_SavedForm, 0); + FPDFPage_InsertObject(page, green_rect2); + FPDF_BITMAP new_bitmap = RenderPageWithFlags(page, m_SavedForm, 0); const char last_md5[] = "4b5b00f824620f8c9b8801ebb98e1cdd"; CompareBitmap(new_bitmap, 612, 792, last_md5); FPDFBitmap_Destroy(new_bitmap); - EXPECT_TRUE(FPDFPage_GenerateContent(m_SavedPage)); + EXPECT_TRUE(FPDFPage_GenerateContent(page)); // Now save the result, closing the page and document EXPECT_TRUE(FPDF_SaveAsCopy(m_SavedDocument, this, 0)); - CloseSavedPage(); + CloseSavedPage(page); CloseSavedDocument(); // Render the saved result diff --git a/fpdfsdk/fpdfeditpath_embeddertest.cpp b/fpdfsdk/fpdfeditpath_embeddertest.cpp index 71af2fad55..59e5dbbabf 100644 --- a/fpdfsdk/fpdfeditpath_embeddertest.cpp +++ b/fpdfsdk/fpdfeditpath_embeddertest.cpp @@ -32,7 +32,7 @@ TEST_F(FPDFEditPathEmbedderTest, VerifyCorrectColoursReturned) { page = nullptr; OpenSavedDocument(); - page = LoadSavedPage(); + page = LoadSavedPage(0); ASSERT(page); for (size_t i = 0; i < 256; ++i) { @@ -58,6 +58,6 @@ TEST_F(FPDFEditPathEmbedderTest, VerifyCorrectColoursReturned) { EXPECT_EQ(i, a); } - CloseSavedPage(); + CloseSavedPage(page); CloseSavedDocument(); } |