OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "public/fpdf_edit.h" | 5 #include "public/fpdf_edit.h" |
6 #include "public/fpdfview.h" | 6 #include "public/fpdfview.h" |
7 #include "testing/embedder_test.h" | 7 #include "testing/embedder_test.h" |
| 8 #include "testing/gmock/include/gmock/gmock-matchers.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "testing/test_support.h" |
9 | 11 |
10 class FPDFEditEmbeddertest : public EmbedderTest {}; | 12 class FPDFEditEmbeddertest : public EmbedderTest, public TestSaver {}; |
11 | 13 |
12 TEST_F(FPDFEditEmbeddertest, EmptyCreation) { | 14 TEST_F(FPDFEditEmbeddertest, EmptyCreation) { |
13 EXPECT_TRUE(CreateEmptyDocument()); | 15 EXPECT_TRUE(CreateEmptyDocument()); |
14 FPDF_PAGE page = FPDFPage_New(document(), 1, 640.0, 480.0); | 16 FPDF_PAGE page = FPDFPage_New(document(), 1, 640.0, 480.0); |
15 EXPECT_NE(nullptr, page); | 17 EXPECT_NE(nullptr, page); |
16 EXPECT_TRUE(FPDFPage_GenerateContent(page)); | 18 EXPECT_TRUE(FPDFPage_GenerateContent(page)); |
| 19 EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0)); |
| 20 EXPECT_THAT(GetString(), testing::StartsWith("%PDF-1.7\r\n")); |
17 FPDFPage_Delete(document(), 1); | 21 FPDFPage_Delete(document(), 1); |
18 } | 22 } |
OLD | NEW |