summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_doc_embeddertest.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-09 21:19:17 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-09 21:19:17 +0000
commita021def0a4a500ee8373d37f7122097927387873 (patch)
tree919c52553558cd3a92790cae5b2bb4f79c1a497c /fpdfsdk/fpdf_doc_embeddertest.cpp
parent8153561249b45ba45f6e393cc081eb1101f3f7a6 (diff)
downloadpdfium-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/fpdf_doc_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdf_doc_embeddertest.cpp7
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);