Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Unified Diff: fpdfsdk/fpdf_flatten_embeddertest.cpp

Issue 2489653003: Fix abort above FPDFPage_Flatten (Closed)
Patch Set: rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/fpdf_flatten.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdf_flatten_embeddertest.cpp
diff --git a/fpdfsdk/fpdf_flatten_embeddertest.cpp b/fpdfsdk/fpdf_flatten_embeddertest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d709f59053f7e5acf84c18b5ac079863e38fff2c
--- /dev/null
+++ b/fpdfsdk/fpdf_flatten_embeddertest.cpp
@@ -0,0 +1,40 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/fxcrt/fx_basic.h"
+#include "public/fpdf_flatten.h"
+#include "public/fpdfview.h"
+#include "testing/embedder_test.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/test_support.h"
+
+namespace {
+
+class FPDFFlattenEmbeddertest : public EmbedderTest {};
+
+} // namespace
+
+TEST_F(FPDFFlattenEmbeddertest, FlatNothing) {
+ EXPECT_TRUE(OpenDocument("hello_world.pdf"));
+ FPDF_PAGE page = LoadPage(0);
+ EXPECT_TRUE(page);
+ EXPECT_EQ(FLATTEN_NOTHINGTODO, FPDFPage_Flatten(page, FLAT_NORMALDISPLAY));
+ UnloadPage(page);
+}
+
+TEST_F(FPDFFlattenEmbeddertest, FlatNormal) {
+ EXPECT_TRUE(OpenDocument("annotiter.pdf"));
+ FPDF_PAGE page = LoadPage(0);
+ EXPECT_TRUE(page);
+ EXPECT_EQ(FLATTEN_SUCCESS, FPDFPage_Flatten(page, FLAT_NORMALDISPLAY));
+ UnloadPage(page);
+}
+
+TEST_F(FPDFFlattenEmbeddertest, FlatPrint) {
+ EXPECT_TRUE(OpenDocument("annotiter.pdf"));
+ FPDF_PAGE page = LoadPage(0);
+ EXPECT_TRUE(page);
+ EXPECT_EQ(FLATTEN_SUCCESS, FPDFPage_Flatten(page, FLAT_PRINT));
+ UnloadPage(page);
+}
« no previous file with comments | « fpdfsdk/fpdf_flatten.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698