5#include "core/fpdfdoc/cpdf_action.h"
7#include "core/fpdfapi/parser/cpdf_dictionary.h"
8#include "core/fpdfapi/parser/cpdf_name.h"
9#include "core/fpdfapi/parser/cpdf_string.h"
10#include "core/fxcrt/retain_ptr.h"
11#include "testing/gtest/include/gtest/gtest.h"
18 dict->SetNewFor<CPDF_Name>(
"Type",
"Action");
19 dict->SetNewFor<CPDF_Name>(
"S", action_type);
26 dict->SetNewFor<CPDF_Name>(
"S", action_type);
33 dict->SetNewFor<CPDF_Name>(
"Type",
"Lights");
34 dict->SetNewFor<CPDF_Name>(
"S", action_type);
41 dict->SetNewFor<CPDF_Name>(
"Type",
"Action");
42 dict->SetNewFor<CPDF_String>(
"S", action_type);
49 dict->SetNewFor<CPDF_String>(
"S", action_type);
56 static constexpr struct {
57 const char* action_type;
59 } kValidTestCases[] = {
81 for (
const auto& test_case : kValidTestCases) {
84 CPDF_Action action(CreateActionDictWithType(test_case.action_type));
85 EXPECT_EQ(test_case.expected_type, action
.GetType());
89 CPDF_Action action(CreateActionDictWithoutType(test_case.action_type));
90 EXPECT_EQ(test_case.expected_type, action
.GetType());
95 for (
const auto& test_case : kValidTestCases) {
99 CreateActionDictWithInvalidType(test_case.action_type));
105 CreateInvalidActionDictWithType(test_case.action_type));
111 CreateInvalidActionDictWithoutType(test_case.action_type));
116 static constexpr const char* kInvalidTestCases[] = {
123 for (
const char* test_case : kInvalidTestCases) {
124 CPDF_Action action(CreateActionDictWithType(test_case));
fxcrt::ByteString ByteString
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
TEST(FXCRYPT, MD5GenerateEmtpyData)