diff options
Diffstat (limited to 'core/fpdfapi/edit/cpdf_creator_embeddertest.cpp')
-rw-r--r-- | core/fpdfapi/edit/cpdf_creator_embeddertest.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/core/fpdfapi/edit/cpdf_creator_embeddertest.cpp b/core/fpdfapi/edit/cpdf_creator_embeddertest.cpp index 9d849c16a..8dbad0c63 100644 --- a/core/fpdfapi/edit/cpdf_creator_embeddertest.cpp +++ b/core/fpdfapi/edit/cpdf_creator_embeddertest.cpp @@ -1,13 +1,11 @@ -// Copyright 2017 PDFium Authors. All rights reserved. +// Copyright 2017 The PDFium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <cstring> -#include <memory> +#include <string.h> + #include <string> -#include <vector> -#include "core/fxcrt/fx_system.h" #include "public/cpp/fpdf_scopers.h" #include "public/fpdf_annot.h" #include "public/fpdf_edit.h" @@ -48,7 +46,7 @@ TEST_F(CPDF_CreatorEmbedderTest, SavedDocsAreEqualAfterParse) { } TEST_F(CPDF_CreatorEmbedderTest, BUG_873) { - EXPECT_TRUE(OpenDocument("embedded_attachments.pdf")); + ASSERT_TRUE(OpenDocument("embedded_attachments.pdf")); EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0)); // Cannot match second part of the ID since it is randomly generated. @@ -69,24 +67,24 @@ TEST_F(CPDF_CreatorEmbedderTest, SaveLinearizedInfo) { FileAccessForTesting file_acc("linearized.pdf"); FakeFileAccess fake_acc(&file_acc); - avail_ = FPDFAvail_Create(fake_acc.GetFileAvail(), fake_acc.GetFileAccess()); + CreateAvail(fake_acc.GetFileAvail(), fake_acc.GetFileAccess()); while (PDF_DATA_AVAIL != - FPDFAvail_IsDocAvail(avail_, fake_acc.GetDownloadHints())) { + FPDFAvail_IsDocAvail(avail(), fake_acc.GetDownloadHints())) { fake_acc.SetRequestedDataAvailable(); } - document_ = FPDFAvail_GetDocument(avail_, nullptr); - ASSERT_TRUE(document_); + SetDocumentFromAvail(); + ASSERT_TRUE(document()); // Load second page, to parse additional crossref sections. while (PDF_DATA_AVAIL != - FPDFAvail_IsPageAvail(avail_, 1, fake_acc.GetDownloadHints())) { + FPDFAvail_IsPageAvail(avail(), 1, fake_acc.GetDownloadHints())) { fake_acc.SetRequestedDataAvailable(); } // Simulate downloading of whole file. fake_acc.SetWholeFileAvailable(); // Save document. - EXPECT_TRUE(FPDF_SaveAsCopy(document_, this, 0)); + EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0)); const std::string saved_doc = GetString(); EXPECT_THAT(saved_doc, ::testing::HasSubstr("/Info")); |