Chromium Code Reviews| Index: fpdfsdk/fpdfdoc_embeddertest.cpp |
| diff --git a/fpdfsdk/fpdfdoc_embeddertest.cpp b/fpdfsdk/fpdfdoc_embeddertest.cpp |
| index 855235858b2bada749bba8cfcf3357b9ad264072..f0245b35796543b867b5d116cde8dc2a6c2953d8 100644 |
| --- a/fpdfsdk/fpdfdoc_embeddertest.cpp |
| +++ b/fpdfsdk/fpdfdoc_embeddertest.cpp |
| @@ -6,6 +6,7 @@ |
| #include "core/fxcrt/include/fx_string.h" |
| #include "public/fpdf_doc.h" |
| +#include "public/fpdf_edit.h" |
| #include "public/fpdfview.h" |
| #include "testing/embedder_test.h" |
| #include "testing/fx_string_testhelpers.h" |
| @@ -138,3 +139,13 @@ TEST_F(FPDFDocEmbeddertest, FindBookmarks_bug420) { |
| GetFPDFWideString(L"anything"); |
| EXPECT_EQ(nullptr, FPDFBookmark_Find(document(), title.get())); |
| } |
| + |
| +TEST_F(FPDFDocEmbeddertest, DeletePage) { |
| + EXPECT_TRUE(OpenDocument("hello_world.pdf")); |
| +#if PDF_ENABLE_XFA |
| + FPDF_LoadXFA(document()); |
|
Lei Zhang
2016/04/25 20:52:59
Check return value?
dsinclair
2016/04/25 21:01:13
Removed, left over from initially trying to make t
|
| +#endif // PDF_ENABLE_XFA |
| + int count = FPDF_GetPageCount(document()); |
|
Lei Zhang
2016/04/25 20:52:59
Check |count| before continuing?
dsinclair
2016/04/25 21:01:13
Done.
|
| + FPDFPage_Delete(document(), 0); |
| + EXPECT_EQ(count - 1, FPDF_GetPageCount(document())); |
| +} |