summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfview_embeddertest.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-01-16 16:39:05 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-16 16:39:05 +0000
commit2615590b040a2d49413be41cad298e242d1072e8 (patch)
treee4c084d34019b6fd576005ca6f3d352a25b04961 /fpdfsdk/fpdfview_embeddertest.cpp
parent2056fac754e679baea695390854fe7b0ce7acb28 (diff)
downloadpdfium-2615590b040a2d49413be41cad298e242d1072e8.tar.xz
Add FPDF_GetPageBoundingBox API.chromium/3323
This API returns the intersection of the media box and the crop box of a page. Bug: pdfium:973 Change-Id: I57a19ee526ea6d4cd621e1ad6019e51f69f92308 Reviewed-on: https://pdfium-review.googlesource.com/22810 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfview_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdfview_embeddertest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfview_embeddertest.cpp b/fpdfsdk/fpdfview_embeddertest.cpp
index 0055099dd8..7e93574059 100644
--- a/fpdfsdk/fpdfview_embeddertest.cpp
+++ b/fpdfsdk/fpdfview_embeddertest.cpp
@@ -99,8 +99,17 @@ TEST_F(FPDFViewEmbeddertest, Page) {
EXPECT_TRUE(OpenDocument("about_blank.pdf"));
FPDF_PAGE page = LoadPage(0);
EXPECT_NE(nullptr, page);
+
EXPECT_EQ(612.0, FPDF_GetPageWidth(page));
EXPECT_EQ(792.0, FPDF_GetPageHeight(page));
+
+ FS_RECTF rect;
+ EXPECT_TRUE(FPDF_GetPageBoundingBox(page, &rect));
+ EXPECT_EQ(0.0, rect.left);
+ EXPECT_EQ(0.0, rect.bottom);
+ EXPECT_EQ(612.0, rect.right);
+ EXPECT_EQ(792.0, rect.top);
+
UnloadPage(page);
EXPECT_EQ(nullptr, LoadPage(1));
}