diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-10-09 21:19:17 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-09 21:19:17 +0000 |
commit | a021def0a4a500ee8373d37f7122097927387873 (patch) | |
tree | 919c52553558cd3a92790cae5b2bb4f79c1a497c /fpdfsdk | |
parent | 8153561249b45ba45f6e393cc081eb1101f3f7a6 (diff) | |
download | pdfium-a021def0a4a500ee8373d37f7122097927387873.tar.xz |
Add more FPDFLink_* public API coverage
Change-Id: Ica4c9859b1b4b7f1b4d44a75497becdd956f2600
Reviewed-on: https://pdfium-review.googlesource.com/c/43752
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/fpdf_doc_embeddertest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_doc_embeddertest.cpp b/fpdfsdk/fpdf_doc_embeddertest.cpp index dc367d8e26..d90cc370e3 100644 --- a/fpdfsdk/fpdf_doc_embeddertest.cpp +++ b/fpdfsdk/fpdf_doc_embeddertest.cpp @@ -165,11 +165,18 @@ TEST_F(FPDFDocEmbeddertest, BUG_821454) { FPDF_PAGE page = LoadPage(0); ASSERT_TRUE(page); + // Cover some NULL arg cases while we're at it. + EXPECT_FALSE(FPDFLink_GetLinkAtPoint(nullptr, 150, 360)); + EXPECT_EQ(-1, FPDFLink_GetLinkZOrderAtPoint(nullptr, 150, 360)); + FPDF_LINK link1 = FPDFLink_GetLinkAtPoint(page, 150, 360); ASSERT_TRUE(link1); FPDF_LINK link2 = FPDFLink_GetLinkAtPoint(page, 150, 420); ASSERT_TRUE(link2); + EXPECT_EQ(0, FPDFLink_GetLinkZOrderAtPoint(page, 150, 360)); + EXPECT_EQ(1, FPDFLink_GetLinkZOrderAtPoint(page, 150, 420)); + FPDF_DEST dest1 = FPDFLink_GetDest(document(), link1); ASSERT_TRUE(dest1); FPDF_DEST dest2 = FPDFLink_GetDest(document(), link2); |