summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-09 22:12:49 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-09 22:12:49 +0000
commit8e926a4c3079de0d56304258b460592c92c3a902 (patch)
treee399aa393786c186e5f33c3aea91bfd3c4a016d8
parent95860d77fb882317da74ec614ff841fcacdcaa83 (diff)
downloadpdfium-8e926a4c3079de0d56304258b460592c92c3a902.tar.xz
Beef up FPDFTransformEmbedderTest.
Change-Id: I53b7c24c2b8f126cb2d2c676a02ccade76966fe8 Reviewed-on: https://pdfium-review.googlesource.com/c/43753 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
-rw-r--r--fpdfsdk/fpdf_transformpage_embeddertest.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_transformpage_embeddertest.cpp b/fpdfsdk/fpdf_transformpage_embeddertest.cpp
index 1ebd0f054c..0a8e3e72e3 100644
--- a/fpdfsdk/fpdf_transformpage_embeddertest.cpp
+++ b/fpdfsdk/fpdf_transformpage_embeddertest.cpp
@@ -99,3 +99,24 @@ TEST_F(FPDFTransformEmbedderTest, NoCropBox) {
UnloadPage(page);
}
+
+TEST_F(FPDFTransformEmbedderTest, ClipPath) {
+ ASSERT_TRUE(OpenDocument("hello_world.pdf"));
+
+ FPDF_PAGE page = LoadPage(0);
+ ASSERT_TRUE(page);
+
+ FPDF_CLIPPATH clip = FPDF_CreateClipPath(10.0f, 10.0f, 90.0f, 90.0f);
+ EXPECT_TRUE(clip);
+
+ // NULL arg call is a no-op.
+ FPDFPage_InsertClipPath(nullptr, clip);
+
+ // Do actual work.
+ FPDFPage_InsertClipPath(page, clip);
+
+ // TODO(tsepez): test how inserting path affects page rendering.
+
+ FPDF_DestroyClipPath(clip);
+ UnloadPage(page);
+}