From abe828092706c6c2c21d89dae93bc7efa854b67d Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 9 Aug 2017 13:33:31 -0700 Subject: Add a FPDF_GetFileVersion() test for a linearized document. Change the CPDFParserEmbeddertest.Feature_Linearized_Loading test case into FPDFViewEmbeddertest.LinearizedDocument, and add a call to FPDF_GetFileVersion(). Change-Id: I0272c1e71c6f61393838bd3db41b154c4f5620ba Reviewed-on: https://pdfium-review.googlesource.com/10450 Reviewed-by: dsinclair Commit-Queue: Lei Zhang --- core/fpdfapi/parser/cpdf_parser_embeddertest.cpp | 4 ---- fpdfsdk/fpdfview_embeddertest.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/fpdfapi/parser/cpdf_parser_embeddertest.cpp b/core/fpdfapi/parser/cpdf_parser_embeddertest.cpp index f523d6b31b..fa3a76a4c4 100644 --- a/core/fpdfapi/parser/cpdf_parser_embeddertest.cpp +++ b/core/fpdfapi/parser/cpdf_parser_embeddertest.cpp @@ -31,10 +31,6 @@ TEST_F(CPDFParserEmbeddertest, Bug_544880) { (void)GetPageCount(); } -TEST_F(CPDFParserEmbeddertest, Feature_Linearized_Loading) { - EXPECT_TRUE(OpenDocument("feature_linearized_loading.pdf", nullptr, true)); -} - TEST_F(CPDFParserEmbeddertest, Bug_325a) { EXPECT_FALSE(OpenDocument("bug_325_a.pdf")); } diff --git a/fpdfsdk/fpdfview_embeddertest.cpp b/fpdfsdk/fpdfview_embeddertest.cpp index a986a1cd96..00075876f6 100644 --- a/fpdfsdk/fpdfview_embeddertest.cpp +++ b/fpdfsdk/fpdfview_embeddertest.cpp @@ -64,6 +64,13 @@ TEST_F(FPDFViewEmbeddertest, EmptyDocument) { EXPECT_EQ(0u, FPDF_CountNamedDests(document())); } +TEST_F(FPDFViewEmbeddertest, LinearizedDocument) { + EXPECT_TRUE(OpenDocument("feature_linearized_loading.pdf", nullptr, true)); + int version; + EXPECT_TRUE(FPDF_GetFileVersion(document(), &version)); + EXPECT_EQ(16, version); +} + TEST_F(FPDFViewEmbeddertest, Page) { EXPECT_TRUE(OpenDocument("about_blank.pdf")); FPDF_PAGE page = LoadPage(0); -- cgit v1.2.3