Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cffl_combobox_embeddertest.cpp
Go to the documentation of this file.
1
// Copyright 2022 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#
include
"fpdfsdk/formfiller/cffl_combobox.h"
6
7
#
include
"fpdfsdk/pwl/cpwl_combo_box_embeddertest.h"
8
#
include
"testing/gtest/include/gtest/gtest.h"
9
10
class
CFFLComboBoxEmbedderTest
:
public
CPWLComboBoxEmbedderTest
{};
11
12
TEST_F
(
CFFLComboBoxEmbedderTest
,
GetActionData
) {
13
FormFillerAndWindowSetup(GetCPDFSDKAnnotNormal());
14
{
15
CFFL_FieldAction
result;
16
GetCFFLFormField()->GetActionData(GetPageView(),
CPDF_AAction
::
kKeyStroke
,
17
result);
18
EXPECT_EQ(L"Banana", result.sValue);
19
EXPECT_EQ(L"Banana", result.sChangeEx);
20
}
21
{
22
CFFL_FieldAction
result;
23
GetCFFLFormField()->GetActionData(GetPageView(),
CPDF_AAction
::
kValidate
,
24
result);
25
EXPECT_EQ(L"Banana", result.sValue);
26
EXPECT_EQ(L"", result.sChangeEx);
27
}
28
{
29
CFFL_FieldAction
result;
30
GetCFFLFormField()->GetActionData(GetPageView(),
CPDF_AAction
::
kGetFocus
,
31
result);
32
EXPECT_EQ(L"Banana", result.sValue);
33
EXPECT_EQ(L"", result.sChangeEx);
34
}
35
}
36
37
TEST_F
(
CFFLComboBoxEmbedderTest
,
SetActionData
) {
38
FormFillerAndWindowSetup(GetCPDFSDKAnnotNormal());
39
CFFL_FieldAction
input_fa;
40
input_fa
.
nSelStart
= 2;
41
input_fa
.
nSelEnd
= 4;
42
input_fa.sChange = L"Hamster";
43
GetCFFLFormField()->SetActionData(GetPageView(),
CPDF_AAction
::
kKeyStroke
,
44
input_fa);
45
46
CFFL_FieldAction
output_fa;
47
GetCFFLFormField()->GetActionData(GetPageView(),
CPDF_AAction
::
kKeyStroke
,
48
output_fa);
49
EXPECT_EQ(L"BaHamsterna", output_fa.sValue);
50
}
TEST_F
TEST_F(CFFLComboBoxEmbedderTest, GetActionData)
Definition
cffl_combobox_embeddertest.cpp:12
CFFLComboBoxEmbedderTest
Definition
cffl_combobox_embeddertest.cpp:10
CPDF_AAction
Definition
cpdf_aaction.h:14
CPDF_AAction::kKeyStroke
@ kKeyStroke
Definition
cpdf_aaction.h:29
CPDF_AAction::kValidate
@ kValidate
Definition
cpdf_aaction.h:31
CPDF_AAction::kGetFocus
@ kGetFocus
Definition
cpdf_aaction.h:21
CPWLComboBoxEmbedderTest
Definition
cpwl_combo_box_embeddertest.h:18
CFFL_FieldAction
Definition
cffl_fieldaction.h:12
CFFL_FieldAction::nSelStart
int nSelStart
Definition
cffl_fieldaction.h:24
CFFL_FieldAction::nSelEnd
int nSelEnd
Definition
cffl_fieldaction.h:23
qtwebengine
src
3rdparty
chromium
third_party
pdfium
fpdfsdk
formfiller
cffl_combobox_embeddertest.cpp
Generated on
for Qt by
1.18.0