chromium/third_party/pdfium/fpdfsdk/fpdf_annot_embeddertest.cpp

// 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 "public/fpdf_annot.h"

#include <limits.h>

#include <algorithm>
#include <string>
#include <type_traits>
#include <vector>

#include "build/build_config.h"
#include "constants/annotation_common.h"
#include "core/fpdfapi/page/cpdf_annotcontext.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fxcrt/compiler_specific.h"
#include "core/fxcrt/containers/contains.h"
#include "core/fxcrt/fx_memcpy_wrappers.h"
#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/span.h"
#include "core/fxge/cfx_defaultrenderdevice.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "public/cpp/fpdf_scopers.h"
#include "public/fpdf_attachment.h"
#include "public/fpdf_edit.h"
#include "public/fpdf_formfill.h"
#include "public/fpdfview.h"
#include "testing/embedder_test.h"
#include "testing/embedder_test_constants.h"
#include "testing/fx_string_testhelpers.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/utils/hash.h"

AnnotationStampWithApChecksum;

namespace {

const wchar_t kStreamData[] =;

void VerifyFocusableAnnotSubtypes(
    FPDF_FORMHANDLE form_handle,
    pdfium::span<const FPDF_ANNOTATION_SUBTYPE> expected_subtypes) {}

void SetAndVerifyFocusableAnnotSubtypes(
    FPDF_FORMHANDLE form_handle,
    pdfium::span<const FPDF_ANNOTATION_SUBTYPE> subtypes) {}

void VerifyAnnotationSubtypesAndFocusability(
    FPDF_FORMHANDLE form_handle,
    FPDF_PAGE page,
    pdfium::span<const FPDF_ANNOTATION_SUBTYPE> expected_subtypes,
    pdfium::span<const FPDF_ANNOTATION_SUBTYPE> expected_focusable_subtypes) {}

void VerifyUriActionInLink(FPDF_DOCUMENT doc,
                           FPDF_LINK link,
                           const std::string& expected_uri) {}

}  // namespace

class FPDFAnnotEmbedderTest : public EmbedderTest {};

TEST_F(FPDFAnnotEmbedderTest, SetAP) {}

TEST_F(FPDFAnnotEmbedderTest, SetAPWithOpacity) {}

TEST_F(FPDFAnnotEmbedderTest, InkListAPIValidations) {}

TEST_F(FPDFAnnotEmbedderTest, RemoveInkList) {}

TEST_F(FPDFAnnotEmbedderTest, BadParams) {}

TEST_F(FPDFAnnotEmbedderTest, BadAnnotsEntry) {}

TEST_F(FPDFAnnotEmbedderTest, RenderAnnotWithOnlyRolloverAP) {}

TEST_F(FPDFAnnotEmbedderTest, RenderMultilineMarkupAnnotWithoutAP) {}

TEST_F(FPDFAnnotEmbedderTest, ExtractHighlightLongContent) {}

TEST_F(FPDFAnnotEmbedderTest, ExtractInkMultiple) {}

TEST_F(FPDFAnnotEmbedderTest, AddIllegalSubtypeAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, AddFirstTextAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, AddAndSaveLinkAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, AddAndSaveUnderlineAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, GetAndSetQuadPoints) {}

TEST_F(FPDFAnnotEmbedderTest, ModifyRectQuadpointsWithAP) {}

TEST_F(FPDFAnnotEmbedderTest, CountAttachmentPoints) {}

TEST_F(FPDFAnnotEmbedderTest, RemoveAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, AddAndModifyPath) {}

TEST_F(FPDFAnnotEmbedderTest, ModifyAnnotationFlags) {}

TEST_F(FPDFAnnotEmbedderTest, AddAndModifyImage) {}

TEST_F(FPDFAnnotEmbedderTest, AddAndModifyText) {}

TEST_F(FPDFAnnotEmbedderTest, GetSetStringValue) {}

TEST_F(FPDFAnnotEmbedderTest, GetNumberValue) {}

TEST_F(FPDFAnnotEmbedderTest, GetSetAP) {}

TEST_F(FPDFAnnotEmbedderTest, RemoveOptionalAP) {}

TEST_F(FPDFAnnotEmbedderTest, RemoveRequiredAP) {}

TEST_F(FPDFAnnotEmbedderTest, ExtractLinkedAnnotations) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormFieldFlagsTextField) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormFieldFlagsComboBox) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormAnnotNull) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormAnnotAndCheckFlagsTextField) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormAnnotAndCheckFlagsComboBox) {}

TEST_F(FPDFAnnotEmbedderTest, Bug1206) {}

TEST_F(FPDFAnnotEmbedderTest, Bug1212) {}

TEST_F(FPDFAnnotEmbedderTest, GetOptionCountCombobox) {}

TEST_F(FPDFAnnotEmbedderTest, GetOptionCountListbox) {}

TEST_F(FPDFAnnotEmbedderTest, GetOptionCountInvalidAnnotations) {}

TEST_F(FPDFAnnotEmbedderTest, GetOptionLabelCombobox) {}

TEST_F(FPDFAnnotEmbedderTest, GetOptionLabelListbox) {}

TEST_F(FPDFAnnotEmbedderTest, GetOptionLabelInvalidAnnotations) {}

TEST_F(FPDFAnnotEmbedderTest, IsOptionSelectedCombobox) {}

TEST_F(FPDFAnnotEmbedderTest, IsOptionSelectedListbox) {}

TEST_F(FPDFAnnotEmbedderTest, IsOptionSelectedInvalidAnnotations) {}

TEST_F(FPDFAnnotEmbedderTest, GetFontSizeCombobox) {}

TEST_F(FPDFAnnotEmbedderTest, GetFontSizeTextField) {}

TEST_F(FPDFAnnotEmbedderTest, GetFontSizeInvalidAnnotationTypes) {}

TEST_F(FPDFAnnotEmbedderTest, GetFontSizeInvalidArguments) {}

TEST_F(FPDFAnnotEmbedderTest, GetFontSizeNegative) {}

TEST_F(FPDFAnnotEmbedderTest, GetFontColor) {}

TEST_F(FPDFAnnotEmbedderTest, IsCheckedCheckbox) {}

TEST_F(FPDFAnnotEmbedderTest, IsCheckedCheckboxReadOnly) {}

TEST_F(FPDFAnnotEmbedderTest, IsCheckedRadioButton) {}

TEST_F(FPDFAnnotEmbedderTest, IsCheckedRadioButtonReadOnly) {}

TEST_F(FPDFAnnotEmbedderTest, IsCheckedInvalidArguments) {}

TEST_F(FPDFAnnotEmbedderTest, IsCheckedInvalidWidgetType) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormFieldType) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormFieldValueTextField) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormFieldValueComboBox) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormFieldNameTextField) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormFieldNameComboBox) {}

TEST_F(FPDFAnnotEmbedderTest, FocusableAnnotSubtypes) {}

TEST_F(FPDFAnnotEmbedderTest, FocusableAnnotRendering) {}

TEST_F(FPDFAnnotEmbedderTest, GetLinkFromAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormControlCountRadioButton) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormControlCountCheckBox) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormControlCountInvalidAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormControlIndexRadioButton) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormControlIndexCheckBox) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormControlIndexInvalidAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormFieldExportValueRadioButton) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormFieldExportValueCheckBox) {}

TEST_F(FPDFAnnotEmbedderTest, GetFormFieldExportValueInvalidAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, Redactannotation) {}

TEST_F(FPDFAnnotEmbedderTest, PolygonAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, InkAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, LineAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, AnnotationBorder) {}

TEST_F(FPDFAnnotEmbedderTest, AnnotationJavaScript) {}

TEST_F(FPDFAnnotEmbedderTest, FormFieldAlternateName) {}

// Due to https://crbug.com/pdfium/570, the AnnotationBorder test above cannot
// actually render the line annotations inside line_annot.pdf. For now, use a
// square annotation in annots.pdf for testing.
TEST_F(FPDFAnnotEmbedderTest, AnnotationBorderRendering) {}

TEST_F(FPDFAnnotEmbedderTest, GetAndAddFileAttachmentAnnotation) {}

TEST_F(FPDFAnnotEmbedderTest, BadCasesFileAttachmentAnnotation) {}