summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfannot_embeddertest.cpp6
-rw-r--r--fpdfsdk/fpdfformfill_embeddertest.cpp15
2 files changed, 12 insertions, 9 deletions
diff --git a/fpdfsdk/fpdfannot_embeddertest.cpp b/fpdfsdk/fpdfannot_embeddertest.cpp
index 4e32b19ff9..61cd2aae3d 100644
--- a/fpdfsdk/fpdfannot_embeddertest.cpp
+++ b/fpdfsdk/fpdfannot_embeddertest.cpp
@@ -1384,7 +1384,7 @@ TEST_F(FPDFAnnotEmbeddertest, GetFormAnnotAndCheckFlagsComboBox) {
{
// Retrieve user-editable combobox annotation.
std::unique_ptr<void, FPDFAnnotationDeleter> annot(
- FPDFAnnot_GetFormFieldAtPoint(form_handle(), page, 102, 63));
+ FPDFAnnot_GetFormFieldAtPoint(form_handle(), page, 102, 363));
ASSERT_TRUE(annot);
// Check that interactive form annotation flag values are as expected.
@@ -1397,7 +1397,7 @@ TEST_F(FPDFAnnotEmbeddertest, GetFormAnnotAndCheckFlagsComboBox) {
{
// Retrieve regular combobox annotation.
std::unique_ptr<void, FPDFAnnotationDeleter> annot(
- FPDFAnnot_GetFormFieldAtPoint(form_handle(), page, 102, 113));
+ FPDFAnnot_GetFormFieldAtPoint(form_handle(), page, 102, 413));
ASSERT_TRUE(annot);
// Check that interactive form annotation flag values are as expected.
@@ -1410,7 +1410,7 @@ TEST_F(FPDFAnnotEmbeddertest, GetFormAnnotAndCheckFlagsComboBox) {
{
// Retrieve read-only combobox annotation.
std::unique_ptr<void, FPDFAnnotationDeleter> annot(
- FPDFAnnot_GetFormFieldAtPoint(form_handle(), page, 102, 213));
+ FPDFAnnot_GetFormFieldAtPoint(form_handle(), page, 102, 513));
ASSERT_TRUE(annot);
// Check that interactive form annotation flag values are as expected.
diff --git a/fpdfsdk/fpdfformfill_embeddertest.cpp b/fpdfsdk/fpdfformfill_embeddertest.cpp
index 8b81467822..709bc39bfa 100644
--- a/fpdfsdk/fpdfformfill_embeddertest.cpp
+++ b/fpdfsdk/fpdfformfill_embeddertest.cpp
@@ -224,10 +224,14 @@ class FPDFFormFillComboBoxFormEmbeddertest
}
void SelectEditableFormOption(int item_index) {
+ ASSERT(item_index >= 0);
+ ASSERT(item_index < 3);
SelectOption(item_index, EditableFormDropDown());
}
void SelectNonEditableFormOption(int item_index) {
+ ASSERT(item_index >= 0);
+ ASSERT(item_index < 26);
SelectOption(item_index, NonEditableFormDropDown());
}
@@ -281,10 +285,6 @@ class FPDFFormFillComboBoxFormEmbeddertest
// Selects one of the pre-selected values from a combobox with three options.
// Options are specified by |item_index|, which is 0-based.
void SelectOption(int item_index, const CFX_PointF& point) {
- // Only relevant for comboboxes with three choices and the same dimensions
- // as those in combobox_form.pdf.
- ASSERT(item_index >= 0);
- ASSERT(item_index < 3);
// Navigate to button for drop down and click mouse to reveal options.
ClickOnFormFieldAtPoint(point);
@@ -294,6 +294,9 @@ class FPDFFormFillComboBoxFormEmbeddertest
CFX_PointF option_point = point;
option_point.y -= kChoiceHeight * (item_index + 1);
+ // Move left to avoid scrollbar.
+ option_point.x -= 20;
+
// Navigate to option and click mouse to select it.
ClickOnFormFieldAtPoint(option_point);
}
@@ -301,8 +304,8 @@ class FPDFFormFillComboBoxFormEmbeddertest
static constexpr float kFormBeginX = 102.0;
static constexpr float kFormEndX = 183.0;
static constexpr float kFormDropDownX = 192.0;
- static constexpr float kEditableFormY = 60.0;
- static constexpr float kNonEditableFormY = 110.0;
+ static constexpr float kEditableFormY = 360.0;
+ static constexpr float kNonEditableFormY = 410.0;
};
TEST_F(FPDFFormFillEmbeddertest, FirstTest) {