summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdftext_embeddertest.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-01-30 14:31:58 -0800
committerTom Sepez <tsepez@chromium.org>2015-01-30 14:31:58 -0800
commitb38a900497ab85c5badd5f1cd1f8c00d0c6f580d (patch)
treec4bb1612e8e40005c9befe1bbf966a8d8b4ace3f /fpdfsdk/src/fpdftext_embeddertest.cpp
parent14b2bb0adcd723a463140929cbd9453a799a34e6 (diff)
downloadpdfium-b38a900497ab85c5badd5f1cd1f8c00d0c6f580d.tar.xz
Track formhandles in EmbedderTest class itself
This removes some duplicated code from each individual test. R=thestig@chromium.org Review URL: https://codereview.chromium.org/885403002
Diffstat (limited to 'fpdfsdk/src/fpdftext_embeddertest.cpp')
-rw-r--r--fpdfsdk/src/fpdftext_embeddertest.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/fpdfsdk/src/fpdftext_embeddertest.cpp b/fpdfsdk/src/fpdftext_embeddertest.cpp
index 1457832658..f0d9feb91d 100644
--- a/fpdfsdk/src/fpdftext_embeddertest.cpp
+++ b/fpdfsdk/src/fpdftext_embeddertest.cpp
@@ -30,8 +30,7 @@ class FPDFTextEmbeddertest : public EmbedderTest {
TEST_F(FPDFTextEmbeddertest, Text) {
EXPECT_TRUE(OpenDocument("testing/resources/hello_world.pdf"));
- FPDF_FORMHANDLE form_handle = SetFormFillEnvironment();
- FPDF_PAGE page = LoadPage(0, form_handle);
+ FPDF_PAGE page = LoadPage(0);
EXPECT_NE(nullptr, page);
FPDF_TEXTPAGE textpage = FPDFText_LoadPage(page);
@@ -135,13 +134,11 @@ TEST_F(FPDFTextEmbeddertest, Text) {
EXPECT_EQ(0xbdbd, fixed_buffer[10]);
FPDFText_ClosePage(textpage);
- ClearFormFillEnvironment(form_handle);
}
TEST_F(FPDFTextEmbeddertest, TextSearch) {
EXPECT_TRUE(OpenDocument("testing/resources/hello_world.pdf"));
- FPDF_FORMHANDLE form_handle = SetFormFillEnvironment();
- FPDF_PAGE page = LoadPage(0, form_handle);
+ FPDF_PAGE page = LoadPage(0);
EXPECT_NE(nullptr, page);
FPDF_TEXTPAGE textpage = FPDFText_LoadPage(page);
@@ -242,14 +239,12 @@ TEST_F(FPDFTextEmbeddertest, TextSearch) {
FPDFText_FindClose(search);
FPDFText_ClosePage(textpage);
- ClearFormFillEnvironment(form_handle);
}
// Test that the page has characters despite a bad stream length.
TEST_F(FPDFTextEmbeddertest, StreamLengthPastEndOfFile) {
EXPECT_TRUE(OpenDocument("testing/resources/bug_57.pdf"));
- FPDF_FORMHANDLE form_handle = SetFormFillEnvironment();
- FPDF_PAGE page = LoadPage(0, form_handle);
+ FPDF_PAGE page = LoadPage(0);
EXPECT_NE(nullptr, page);
FPDF_TEXTPAGE textpage = FPDFText_LoadPage(page);
@@ -257,13 +252,11 @@ TEST_F(FPDFTextEmbeddertest, StreamLengthPastEndOfFile) {
EXPECT_EQ(13, FPDFText_CountChars(textpage));
FPDFText_ClosePage(textpage);
- ClearFormFillEnvironment(form_handle);
}
TEST_F(FPDFTextEmbeddertest, WebLinks) {
EXPECT_TRUE(OpenDocument("testing/resources/weblinks.pdf"));
- FPDF_FORMHANDLE form_handle = SetFormFillEnvironment();
- FPDF_PAGE page = LoadPage(0, form_handle);
+ FPDF_PAGE page = LoadPage(0);
EXPECT_NE(nullptr, page);
FPDF_TEXTPAGE textpage = FPDFText_LoadPage(page);
@@ -365,5 +358,4 @@ TEST_F(FPDFTextEmbeddertest, WebLinks) {
FPDFLink_CloseWebLinks(pagelink);
FPDFText_ClosePage(textpage);
- ClearFormFillEnvironment(form_handle);
}