From f766ad219f66543654520f6a1955836f519e26d1 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 14 Mar 2016 13:51:24 -0400 Subject: Move fpdfsdk/src up to fpdfsdk/. This CL moves the files in fpdfsdk/src/ up one level to fpdfsdk/ and fixes up the include paths, include guards and build files. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1799773002 . --- fpdfsdk/fpdfedit_embeddertest.cpp | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 fpdfsdk/fpdfedit_embeddertest.cpp (limited to 'fpdfsdk/fpdfedit_embeddertest.cpp') diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp new file mode 100644 index 0000000000..480ef51dbd --- /dev/null +++ b/fpdfsdk/fpdfedit_embeddertest.cpp @@ -0,0 +1,60 @@ +// 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_edit.h" +#include "public/fpdfview.h" +#include "testing/embedder_test.h" +#include "testing/gmock/include/gmock/gmock-matchers.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "testing/test_support.h" + +class FPDFEditEmbeddertest : public EmbedderTest, public TestSaver {}; + +TEST_F(FPDFEditEmbeddertest, EmptyCreation) { + EXPECT_TRUE(CreateEmptyDocument()); + FPDF_PAGE page = FPDFPage_New(document(), 1, 640.0, 480.0); + EXPECT_NE(nullptr, page); + EXPECT_TRUE(FPDFPage_GenerateContent(page)); + EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0)); + EXPECT_THAT(GetString(), + testing::MatchesRegex( + "%PDF-1.7\r\n" + "%\xA1\xB3\xC5\xD7\r\n" + "1 0 obj\r\n" + "<>\r\n" + "endobj\r\n" + "2 0 obj\r\n" + "<>\r\n" + "endobj\r\n" + "3 0 obj\r\n" + "<>\r\n" + "endobj\r\n" + "4 0 obj\r\n" + "<>/Rotate 0/Type/Page" + ">>\r\n" + "endobj\r\n" + "5 0 obj\r\n" + "<>stream\r\n" + "x\x9C\x3\0\0\0\0\x1\r\n" + "endstream\r\n" + "endobj\r\n" + "xref\r\n" + "0 6\r\n" + "0000000000 65535 f\r\n" + "0000000017 00000 n\r\n" + "0000000066 00000 n\r\n" + "0000000122 00000 n\r\n" + "0000000192 00000 n\r\n" + "0000000301 00000 n\r\n" + "trailer\r\n" + "<<\r\n" + "/Root 1 0 R\r\n" + "/Info 3 0 R\r\n" + "/Size 6/ID\\[<.*><.*>\\]>>\r\n" + "startxref\r\n" + "379\r\n" + "%%EOF\r\n")); + FPDFPage_Delete(document(), 1); +} -- cgit v1.2.3