summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-09-10 17:09:42 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-09-10 17:09:42 +0000
commita5078b7c17f7a6cf3f9875d074443437a6f89d70 (patch)
tree4f62478848b67651abb15fe2297d2732794fa8ba /fpdfsdk
parent5fea8ca820be73f6158d3a532b4162871616390e (diff)
downloadpdfium-a5078b7c17f7a6cf3f9875d074443437a6f89d70.tar.xz
Save and reload document in RemoveMarkedObjectsPrime test.
Change-Id: I3a09188e5d63906c92718ae7568659d2f3ec75a5 Reviewed-on: https://pdfium-review.googlesource.com/42210 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdf_edit_embeddertest.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/fpdfsdk/fpdf_edit_embeddertest.cpp b/fpdfsdk/fpdf_edit_embeddertest.cpp
index 9c51c7c588..47c8f8b394 100644
--- a/fpdfsdk/fpdf_edit_embeddertest.cpp
+++ b/fpdfsdk/fpdf_edit_embeddertest.cpp
@@ -677,19 +677,35 @@ TEST_F(FPDFEditEmbeddertest, RemoveMarkedObjectsPrime) {
EXPECT_EQ(11, FPDFPage_CountObjects(page));
- {
#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_
- const char kNonPrimesMD5[] = "57e76dc7375d896704f0fd6d6d1b9e65";
+ const char kNonPrimesMD5[] = "57e76dc7375d896704f0fd6d6d1b9e65";
#elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
- const char kNonPrimesMD5[] = "4d906b57fba36c70c600cf50d60f508c";
+ const char kNonPrimesMD5[] = "4d906b57fba36c70c600cf50d60f508c";
#else
- const char kNonPrimesMD5[] = "33d9c45bec41ead92a295e252f6b7922";
+ const char kNonPrimesMD5[] = "33d9c45bec41ead92a295e252f6b7922";
#endif
+ {
ScopedFPDFBitmap page_bitmap = RenderPageWithFlags(page, nullptr, 0);
CompareBitmap(page_bitmap.get(), 200, 200, kNonPrimesMD5);
}
+ // Save the file.
+ EXPECT_TRUE(FPDFPage_GenerateContent(page));
+ EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0));
UnloadPage(page);
+
+ // Re-open the file and check the prime marks are not there anymore.
+ OpenSavedDocument(nullptr);
+ FPDF_PAGE saved_page = LoadSavedPage(0);
+ EXPECT_EQ(11, FPDFPage_CountObjects(saved_page));
+
+ {
+ ScopedFPDFBitmap page_bitmap = RenderPageWithFlags(saved_page, nullptr, 0);
+ CompareBitmap(page_bitmap.get(), 200, 200, kNonPrimesMD5);
+ }
+
+ CloseSavedPage(saved_page);
+ CloseSavedDocument();
}
TEST_F(FPDFEditEmbeddertest, RemoveMarks) {