Chromium Code Reviews| Index: fpdfsdk/fpdfppo_embeddertest.cpp |
| diff --git a/fpdfsdk/fpdfppo_embeddertest.cpp b/fpdfsdk/fpdfppo_embeddertest.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..be1c2403f564f33e582b5a644c63525f9dd7d591 |
| --- /dev/null |
| +++ b/fpdfsdk/fpdfppo_embeddertest.cpp |
| @@ -0,0 +1,34 @@ |
| +// 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 "public/fpdf_ppo.h" |
| + |
| +#include "core/fxcrt/fx_basic.h" |
| +#include "public/fpdf_edit.h" |
| +#include "public/fpdfview.h" |
| +#include "testing/embedder_test.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| +#include "testing/test_support.h" |
| + |
| +namespace { |
| + |
| +class FPDFPPOEmbeddertest : public EmbedderTest {}; |
| + |
| +} // namespace |
| + |
| +TEST_F(FPDFPPOEmbeddertest, ImportPages) { |
| + EXPECT_TRUE(OpenDocument("hello_world.pdf")); |
| + |
| + FPDF_PAGE page = LoadPage(0); |
| + EXPECT_TRUE(page); |
| + |
| + FPDF_DOCUMENT output_doc = FPDF_CreateNewDocument(); |
| + EXPECT_TRUE(output_doc); |
| + |
| + FPDF_CopyViewerPreferences(output_doc, document()); |
| + FPDF_ImportPages(output_doc, document(), "0", 0); |
|
Lei Zhang
2016/11/11 23:56:48
Check FPDF_GetPageCount(output_doc) returns 1?
Lei Zhang
2016/11/11 23:56:48
Check return result?
Tom Sepez
2016/11/12 00:35:46
Done.
Tom Sepez
2016/11/12 00:35:46
Done.
|
| + |
| + UnloadPage(page); |
| + FPDF_CloseDocument(output_doc); |
| +} |