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

Unified Diff: fpdfsdk/fpdfsave_embeddertest.cpp

Issue 2495003006: Fix unique ptrs in fpdfppo.cpp (Closed)
Patch Set: rebase 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/fpdfppo_embeddertest.cpp ('k') | testing/resources/bug_664284.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfsave_embeddertest.cpp
diff --git a/fpdfsdk/fpdfsave_embeddertest.cpp b/fpdfsdk/fpdfsave_embeddertest.cpp
index 55a58c2de3bcbec44ac47728dd6e133e8bcdf499..918727027fe1a12bfdbe761531e789a506fe180f 100644
--- a/fpdfsdk/fpdfsave_embeddertest.cpp
+++ b/fpdfsdk/fpdfsave_embeddertest.cpp
@@ -2,10 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "public/fpdf_save.h"
+
#include <string.h>
#include "core/fxcrt/fx_string.h"
-#include "public/fpdf_save.h"
+#include "public/fpdf_edit.h"
+#include "public/fpdf_ppo.h"
#include "public/fpdfview.h"
#include "testing/embedder_test.h"
#include "testing/fx_string_testhelpers.h"
@@ -43,6 +46,21 @@ TEST_F(FPDFSaveEmbedderTest, SaveSimpleDocWithBadVersion) {
EXPECT_THAT(GetString(), testing::StartsWith("%PDF-1.7\r\n"));
}
+TEST_F(FPDFSaveEmbedderTest, SaveCopiedDoc) {
+ EXPECT_TRUE(OpenDocument("hello_world.pdf"));
+
+ FPDF_PAGE page = LoadPage(0);
+ EXPECT_TRUE(page);
+
+ FPDF_DOCUMENT output_doc = FPDF_CreateNewDocument();
+ EXPECT_TRUE(output_doc);
+ EXPECT_TRUE(FPDF_ImportPages(output_doc, document(), "1", 0));
+ EXPECT_TRUE(FPDF_SaveAsCopy(output_doc, this, 0));
+ FPDF_CloseDocument(output_doc);
+
+ UnloadPage(page);
+}
+
TEST_F(FPDFSaveEmbedderTest, BUG_342) {
EXPECT_TRUE(OpenDocument("hello_world.pdf"));
EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0));
« no previous file with comments | « fpdfsdk/fpdfppo_embeddertest.cpp ('k') | testing/resources/bug_664284.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698