Restyle listbox_form.pdf and rename multiselect form field
Rename Listbox_MultiSelectMultipleSelected to
Listbox_MultiSelectMultipleValues in preparation for more test form
fields that will have similar names.
Bug: pdfium:1505
Change-Id: Ie3be1196dab6d01d2c0d1f373fb3d8d1d1cf78af
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/68651
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Daniel Hosseinian <dhoss@chromium.org>
diff --git a/fpdfsdk/fpdf_formfill_embeddertest.cpp b/fpdfsdk/fpdf_formfill_embeddertest.cpp
index d37a95e..680e913 100644
--- a/fpdfsdk/fpdf_formfill_embeddertest.cpp
+++ b/fpdfsdk/fpdf_formfill_embeddertest.cpp
@@ -369,7 +369,7 @@
// - "Listbox_SingleSelect" - Ff: 0, 3 options with pair values.
// - "Listbox_MultiSelect" - Ff: 2097152, 26 options with single values.
// - "Listbox_ReadOnly" - Ff: 1, 3 options with single values.
- // - "Listbox_MultiSelectMultipleSelected" - Ff: 2097152, 5 options with
+ // - "Listbox_MultiSelectMultipleValues" - Ff: 2097152, 5 options with
// single values.
// - "Listbox_SingleSelectLastSelected" - Ff: 0, 10 options with single
// values.
@@ -389,10 +389,10 @@
GetFormTypeAtPoint(MultiSelectSecondVisibleOption()));
EXPECT_EQ(
GetFormType(),
- GetFormTypeAtPoint(MultiSelectMultipleSelectedFirstVisibleOption()));
+ GetFormTypeAtPoint(MultiSelectMultipleValuesFirstVisibleOption()));
EXPECT_EQ(
GetFormType(),
- GetFormTypeAtPoint(MultiSelectMultipleSelectedSecondVisibleOption()));
+ GetFormTypeAtPoint(MultiSelectMultipleValuesSecondVisibleOption()));
EXPECT_EQ(GetFormType(),
GetFormTypeAtPoint(SingleSelectLastSelectedFirstVisibleOption()));
EXPECT_EQ(
@@ -424,15 +424,15 @@
}
}
- void ClickOnMultiSelectMultipleSelectedFormOption(int item_index) {
+ void ClickOnMultiSelectMultipleValuesFormOption(int item_index) {
// Only two indices are visible so can only click on those
// without scrolling.
ASSERT(item_index >= 0);
ASSERT(item_index < 2);
if (item_index == 0) {
- ClickOnFormFieldAtPoint(MultiSelectMultipleSelectedFirstVisibleOption());
+ ClickOnFormFieldAtPoint(MultiSelectMultipleValuesFirstVisibleOption());
} else {
- ClickOnFormFieldAtPoint(MultiSelectMultipleSelectedSecondVisibleOption());
+ ClickOnFormFieldAtPoint(MultiSelectMultipleValuesSecondVisibleOption());
}
}
@@ -456,8 +456,8 @@
FocusOnPoint(MultiSelectFirstVisibleOption());
}
- void FocusOnMultiSelectMultipleSelectedForm() {
- FocusOnPoint(MultiSelectMultipleSelectedFirstVisibleOption());
+ void FocusOnMultiSelectMultipleValuesForm() {
+ FocusOnPoint(MultiSelectMultipleValuesFirstVisibleOption());
}
void FocusOnSingleSelectLastSelectedForm() {
@@ -488,15 +488,15 @@
return point;
}
- const CFX_PointF& MultiSelectMultipleSelectedFirstVisibleOption() const {
- static const CFX_PointF point(
- kFormBeginX, kMultiFormMultipleSelectedYFirstVisibleOption);
+ const CFX_PointF& MultiSelectMultipleValuesFirstVisibleOption() const {
+ static const CFX_PointF point(kFormBeginX,
+ kMultiFormMultipleValuesYFirstVisibleOption);
return point;
}
- const CFX_PointF& MultiSelectMultipleSelectedSecondVisibleOption() const {
- static const CFX_PointF point(
- kFormBeginX, kMultiFormMultipleSelectedYSecondVisibleOption);
+ const CFX_PointF& MultiSelectMultipleValuesSecondVisibleOption() const {
+ static const CFX_PointF point(kFormBeginX,
+ kMultiFormMultipleValuesYSecondVisibleOption);
return point;
}
@@ -518,8 +518,8 @@
static constexpr float kSingleFormYSecondVisibleOption = 358.0;
static constexpr float kMultiFormYFirstVisibleOption = 423.0;
static constexpr float kMultiFormYSecondVisibleOption = 408.0;
- static constexpr float kMultiFormMultipleSelectedYFirstVisibleOption = 223.0;
- static constexpr float kMultiFormMultipleSelectedYSecondVisibleOption = 208.0;
+ static constexpr float kMultiFormMultipleValuesYFirstVisibleOption = 223.0;
+ static constexpr float kMultiFormMultipleValuesYSecondVisibleOption = 208.0;
static constexpr float kSingleFormLastSelectedYFirstVisibleOption = 123.0;
static constexpr float kSingleFormLastSelectedYSecondVisibleOption = 108.0;
};
@@ -2771,12 +2771,12 @@
CheckFocusedFieldText(L"Banana");
}
-TEST_F(FPDFFormFillListBoxFormEmbedderTest, CheckIfMultipleSelected) {
+TEST_F(FPDFFormFillListBoxFormEmbedderTest, CheckIfMultipleSelectedValues) {
// Multiselect field set to 'Gamma' (index 2) and 'Epsilon' (index 4) upon
// opening.
- FocusOnMultiSelectMultipleSelectedForm();
+ FocusOnMultiSelectMultipleValuesForm();
for (int i = 0; i < 5; i++) {
- // TODO(bug_1377): Should be selected at index 2 and index 4.
+ // TODO(bug_1505): Should be selected at index 2 and index 4.
bool expected = false;
CheckIsIndexSelected(i, expected);
}
@@ -2790,7 +2790,7 @@
// TODO(bug_1377): Behavior should be changed to the one described below.
// The top visible option is 'Gamma' (index 2), so the first selection should
// not change. The second selection, 'Epsilon,' should be deselected.
- ClickOnMultiSelectMultipleSelectedFormOption(0);
+ ClickOnMultiSelectMultipleValuesFormOption(0);
for (int i = 0; i < 5; i++) {
bool expected = i == 0;
CheckIsIndexSelected(i, expected);
diff --git a/testing/resources/listbox_form.in b/testing/resources/listbox_form.in
index 354d841..0bc3f2a 100644
--- a/testing/resources/listbox_form.in
+++ b/testing/resources/listbox_form.in
@@ -3,7 +3,7 @@
/Type /Catalog
/Pages 2 0 R
/AcroForm <<
- /Fields [ 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R ]
+ /Fields [8 0 R 9 0 R 10 0 R 11 0 R 12 0 R]
/DR 4 0 R
>>
>>
@@ -11,16 +11,16 @@
{{object 2 0}} <<
/Type /Pages
/Count 1
- /Kids [ 3 0 R ]
+ /Kids [3 0 R]
>>
endobj
{{object 3 0}} <<
/Type /Page
/Parent 2 0 R
/Resources 4 0 R
- /MediaBox [ 0 0 300 600 ]
+ /MediaBox [0 0 300 600]
/Contents 7 0 R
- /Annots [ 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R ]
+ /Annots [8 0 R 9 0 R 10 0 R 11 0 R 12 0 R]
>>
endobj
{{object 4 0}} <<
@@ -56,7 +56,7 @@
/Ff 0
/T (Listbox_SingleSelect)
/DA (0 0 0 rg /F1 12 Tf)
- /Rect [ 100 350 200 380 ]
+ /Rect [100 350 200 380]
/Opt [[(foo) (Foo)] [(bar) (Bar)] [(qux) (Qux)]]
>>
endobj
@@ -67,7 +67,7 @@
/Ff 2097152
/T (Listbox_MultiSelect)
/DA (0 0 0 rg /F1 12 Tf)
- /Rect [ 100 400 200 430 ]
+ /Rect [100 400 200 430]
/Opt [(Apple) (Banana) (Cherry) (Date) (Elderberry) (Fig) (Guava) (Honeydew)
(Indian Fig) (Jackfruit) (Kiwi) (Lemon) (Mango) (Nectarine) (Orange)
(Persimmon) (Quince) (Raspberry) (Strawberry) (Tamarind) (Ugli Fruit)
@@ -82,7 +82,7 @@
/Ff 1
/T (Listbox_ReadOnly)
/DA (0 0 0 rg /F1 12 Tf)
- /Rect [ 100 500 200 530 ]
+ /Rect [100 500 200 530]
/Opt [(Dog) (Elephant) (Frog)]
>>
endobj
@@ -91,9 +91,9 @@
/Subtype /Widget
/FT /Ch
/Ff 2097152
- /T (Listbox_MultiSelectMultipleSelected)
+ /T (Listbox_MultiSelectMultipleValues)
/DA (0 0 0 rg /F1 12 Tf)
- /Rect [ 100 200 200 230 ]
+ /Rect [100 200 200 230]
/Opt [(Alpha) (Beta) (Gamma) (Delta) (Epsilon)]
/V [(Epsilon) (Gamma)]
>>
@@ -105,10 +105,10 @@
/Ff 0
/T (Listbox_SingleSelectLastSelected)
/DA (0 0 0 rg /F1 12 Tf)
- /Rect [ 100 100 200 130 ]
+ /Rect [100 100 200 130]
/Opt [(Alberta) (British Columbia) (Manitoba) (New Brunswick)
(Newfoundland and Labrador) (Nova Scotia) (Ontario)
- (Prince Edward Island) (Quebec) (Saskatchewan) ]
+ (Prince Edward Island) (Quebec) (Saskatchewan)]
/V (Saskatchewan)
/TI 9
>>
diff --git a/testing/resources/listbox_form.pdf b/testing/resources/listbox_form.pdf
index 9e1393e..5a07425 100644
--- a/testing/resources/listbox_form.pdf
+++ b/testing/resources/listbox_form.pdf
@@ -4,7 +4,7 @@
/Type /Catalog
/Pages 2 0 R
/AcroForm <<
- /Fields [ 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R ]
+ /Fields [8 0 R 9 0 R 10 0 R 11 0 R 12 0 R]
/DR 4 0 R
>>
>>
@@ -12,16 +12,16 @@
2 0 obj <<
/Type /Pages
/Count 1
- /Kids [ 3 0 R ]
+ /Kids [3 0 R]
>>
endobj
3 0 obj <<
/Type /Page
/Parent 2 0 R
/Resources 4 0 R
- /MediaBox [ 0 0 300 600 ]
+ /MediaBox [0 0 300 600]
/Contents 7 0 R
- /Annots [ 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R ]
+ /Annots [8 0 R 9 0 R 10 0 R 11 0 R 12 0 R]
>>
endobj
4 0 obj <<
@@ -57,7 +57,7 @@
/Ff 0
/T (Listbox_SingleSelect)
/DA (0 0 0 rg /F1 12 Tf)
- /Rect [ 100 350 200 380 ]
+ /Rect [100 350 200 380]
/Opt [[(foo) (Foo)] [(bar) (Bar)] [(qux) (Qux)]]
>>
endobj
@@ -68,7 +68,7 @@
/Ff 2097152
/T (Listbox_MultiSelect)
/DA (0 0 0 rg /F1 12 Tf)
- /Rect [ 100 400 200 430 ]
+ /Rect [100 400 200 430]
/Opt [(Apple) (Banana) (Cherry) (Date) (Elderberry) (Fig) (Guava) (Honeydew)
(Indian Fig) (Jackfruit) (Kiwi) (Lemon) (Mango) (Nectarine) (Orange)
(Persimmon) (Quince) (Raspberry) (Strawberry) (Tamarind) (Ugli Fruit)
@@ -83,7 +83,7 @@
/Ff 1
/T (Listbox_ReadOnly)
/DA (0 0 0 rg /F1 12 Tf)
- /Rect [ 100 500 200 530 ]
+ /Rect [100 500 200 530]
/Opt [(Dog) (Elephant) (Frog)]
>>
endobj
@@ -92,9 +92,9 @@
/Subtype /Widget
/FT /Ch
/Ff 2097152
- /T (Listbox_MultiSelectMultipleSelected)
+ /T (Listbox_MultiSelectMultipleValues)
/DA (0 0 0 rg /F1 12 Tf)
- /Rect [ 100 200 200 230 ]
+ /Rect [100 200 200 230]
/Opt [(Alpha) (Beta) (Gamma) (Delta) (Epsilon)]
/V [(Epsilon) (Gamma)]
>>
@@ -106,10 +106,10 @@
/Ff 0
/T (Listbox_SingleSelectLastSelected)
/DA (0 0 0 rg /F1 12 Tf)
- /Rect [ 100 100 200 130 ]
+ /Rect [100 100 200 130]
/Opt [(Alberta) (British Columbia) (Manitoba) (New Brunswick)
(Newfoundland and Labrador) (Nova Scotia) (Ontario)
- (Prince Edward Island) (Quebec) (Saskatchewan) ]
+ (Prince Edward Island) (Quebec) (Saskatchewan)]
/V (Saskatchewan)
/TI 9
>>
@@ -118,21 +118,21 @@
0 13
0000000000 65535 f
0000000015 00000 n
-0000000151 00000 n
-0000000216 00000 n
-0000000379 00000 n
-0000000414 00000 n
-0000000447 00000 n
-0000000523 00000 n
-0000000625 00000 n
-0000000832 00000 n
-0000001302 00000 n
-0000001488 00000 n
-0000001741 00000 n
+0000000149 00000 n
+0000000212 00000 n
+0000000371 00000 n
+0000000406 00000 n
+0000000439 00000 n
+0000000515 00000 n
+0000000617 00000 n
+0000000822 00000 n
+0000001290 00000 n
+0000001474 00000 n
+0000001723 00000 n
trailer <<
/Root 1 0 R
/Size 13
>>
startxref
-2119
+2098
%%EOF