Enable more field property tests.
Made possible by the previous patch. Some still require
a different object type.
Change-Id: Ic44f779a9d19c839899081c5f1d2a54b310b98e1
Reviewed-on: https://pdfium-review.googlesource.com/c/45391
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/testing/resources/javascript/field_properties.in b/testing/resources/javascript/field_properties.in
index 21d11a6..51bfa5e 100644
--- a/testing/resources/javascript/field_properties.in
+++ b/testing/resources/javascript/field_properties.in
@@ -193,7 +193,7 @@
try {
// TODO(tsepez): devise tests and uncomment.
testRIProperty(field, "alignment", "left", "center");
- // testRWProperty(field, "borderStyle", "solid", "inset");
+ testRWProperty(field, "borderStyle", "solid", "inset");
// testROProperty(field, "buttonAlignX", "clams");
// testROProperty(field, "buttonAlignY", "clams");
// testROProperty(field, "buttonFitBounds", "clams");
@@ -206,17 +206,17 @@
// testRIProperty(field, "commitOnSelChange", false, true);
// testROProperty(field, "currentValueIndices", "clams");
testXXProperty(field, "defaultStyle");
- // testROProperty(field, "defaultValue", "clams");
+ testRIProperty(field, "defaultValue", "", "clams");
testRIProperty(field, "doNotScroll", false, true);
testRIProperty(field, "doNotSpellCheck", false, true);
- // testROProperty(field, "display", "clams");
+ testRWProperty(field, "display", 2, 3);
testROProperty(field, "doc", "[object global]");
// testROProperty(field, "editable", "clams");
// testROProperty(field, "exportValues", "clams");
testRWProperty(field, "hidden", false, true);
testRIProperty(field, "fileSelect", false, true);
testRIProperty(field, "fillColor", "T", ["RGB", 0, 0, 0]);
- // testROProperty(field, "lineWidth", "clams");
+ testRWProperty(field, "lineWidth", 1, 4);
// testROProperty(field, "highlight", "clams");
testRIProperty(field, "multiline", false, true);
// testROProperty(field, "multipleSelection", "clams");
@@ -224,7 +224,7 @@
// testROProperty(field, "numItems", "clams");
testROProperty(field, "page", 0);
testRIProperty(field, "password", false, 42);
- // testROProperty(field, "print", "clams");
+ testRWProperty(field, "print", true, false);
// testROProperty(field, "radiosInUnison", "clams");
testRIProperty(field, "readonly", false, true);
// testRWProperty(field, "rect", [0,0,0,0], [0,0,0,0]);
diff --git a/testing/resources/javascript/field_properties_expected.txt b/testing/resources/javascript/field_properties_expected.txt
index dad973a..b789834 100644
--- a/testing/resources/javascript/field_properties_expected.txt
+++ b/testing/resources/javascript/field_properties_expected.txt
@@ -6,6 +6,8 @@
Alert: PASS: delay = false
Alert: PASS: alignment = left
Alert: PASS: alignment = left
+Alert: PASS: borderStyle = solid
+Alert: PASS: borderStyle = inset
Alert: PASS: calcOrderIndex = -1
Alert: PASS: calcOrderIndex = -1
Alert: PASS: charLimit = 0
@@ -14,10 +16,14 @@
Alert: PASS: comb = false
Alert: PASS: defaultStyle threw error Field.defaultStyle: Operation not supported.
Alert: PASS: defaultStyle threw error Field.defaultStyle: Operation not supported.
+Alert: PASS: defaultValue =
+Alert: PASS: defaultValue =
Alert: PASS: doNotScroll = false
Alert: PASS: doNotScroll = false
Alert: PASS: doNotSpellCheck = false
Alert: PASS: doNotSpellCheck = false
+Alert: PASS: display = 2
+Alert: PASS: display = 3
Alert: PASS: doc = [object global]
Alert: PASS: doc threw error Field.doc: Operation not supported.
Alert: PASS: hidden = false
@@ -26,6 +32,8 @@
Alert: PASS: fileSelect = false
Alert: PASS: fillColor = T
Alert: PASS: fillColor = T
+Alert: PASS: lineWidth = 1
+Alert: PASS: lineWidth = 4
Alert: PASS: multiline = false
Alert: PASS: multiline = false
Alert: PASS: name = MyField
@@ -34,6 +42,8 @@
Alert: PASS: page threw error Field.page: Cannot assign to readonly property.
Alert: PASS: password = false
Alert: PASS: password = false
+Alert: PASS: print = true
+Alert: PASS: print = false
Alert: PASS: readonly = false
Alert: PASS: readonly = false
Alert: PASS: richText = false