summaryrefslogtreecommitdiff
path: root/testing/resources/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'testing/resources/javascript')
-rw-r--r--testing/resources/javascript/bug_492_1.in95
-rw-r--r--testing/resources/javascript/bug_492_1_expected.txt2
-rw-r--r--testing/resources/javascript/document_methods.in9
-rw-r--r--testing/resources/javascript/document_methods_expected.txt4
4 files changed, 106 insertions, 4 deletions
diff --git a/testing/resources/javascript/bug_492_1.in b/testing/resources/javascript/bug_492_1.in
new file mode 100644
index 0000000000..f2b03b01bc
--- /dev/null
+++ b/testing/resources/javascript/bug_492_1.in
@@ -0,0 +1,95 @@
+{{header}}
+{{object 1 0}} <<
+ /Type /Catalog
+ /Pages 2 0 R
+ /OpenAction 20 0 R
+>>
+endobj
+{{object 2 0}} <<
+ /Type /Pages
+ /Count 2
+ /Kids [
+ 10 0 R
+ 11 0 R
+ ]
+>>
+endobj
+% Page number 0.
+{{object 10 0}} <<
+ /Type /Page
+ /Parent 2 0 R
+ /Resources <<
+ /Font <</F1 15 0 R>>
+ >>
+ /MediaBox [0 0 612 792]
+ /Annots [
+ 22 0 R
+ ]
+ /Tabs /R
+>>
+endobj
+% Page number 1.
+{{object 11 0}} <<
+ /Type /Page
+ /Parent 2 0 R
+ /Resources <<
+ /Font <</F1 15 0 R>>
+ >>
+ /MediaBox [0 0 612 792]
+ /Annots [
+ 22 0 R
+ ]
+ /Tabs /C
+>>
+endobj
+
+% OpenAction action
+{{object 20 0}} <<
+ /Type /Action
+ /S /JavaScript
+ /JS 21 0 R
+>>
+endobj
+% JS program to exexute
+{{object 21 0}} <<
+>>
+stream
+ var annots = this.getAnnots();
+ for (var i = 0; i < annots.length; i++)
+ app.alert(annots[i].name);
+endstream
+endobj
+
+{{object 22 0}} <<
+ /Type /Annot
+ /Subtype /Highlight
+ /QuadPoints [
+ 115.80264
+ 718.9139232
+ 157.211172
+ 718.9139232
+ 115.80264
+ 706.26441
+ 6
+ 157.211172
+ 706.264416
+ ]
+ /Rect [ 115.75062 706.328568 157.001868 719.2715904 ]
+ /F 4
+ /Border [ 0 0 1 ]
+ /C [ 1 1 0 ]
+ /CA 1
+ /Contents <feff>
+ /M (D:20160712221733)
+ /NM (annot_s_name)
+ /P 9 0 R
+ /T <feff004a006100650020004800790075006e0020005000610072006b>
+>>
+endobj
+
+{{xref}}
+trailer <<
+ /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/javascript/bug_492_1_expected.txt b/testing/resources/javascript/bug_492_1_expected.txt
new file mode 100644
index 0000000000..2862e4427a
--- /dev/null
+++ b/testing/resources/javascript/bug_492_1_expected.txt
@@ -0,0 +1,2 @@
+Alert: annot_s_name
+Alert: annot_s_name
diff --git a/testing/resources/javascript/document_methods.in b/testing/resources/javascript/document_methods.in
index cdbd6845c8..8c5a14a59e 100644
--- a/testing/resources/javascript/document_methods.in
+++ b/testing/resources/javascript/document_methods.in
@@ -147,6 +147,13 @@ function testGetAnnot() {
// TODO(tonikitoo): test success cases.
}
+function testGetAnnots() {
+ // Method is present.
+ expect('typeof this.getAnnots', 'function');
+
+ // TODO(tonikitoo): test success cases.
+}
+
function testGetField() {
// Method is present.
expect('typeof this.getField', 'function');
@@ -302,7 +309,6 @@ try {
testUnsupported('this.exportAsXFDF');
testUnsupported('this.extractPages');
testUnsupported('this.getAnnot3D');
- testUnsupported('this.getAnnots');
testUnsupported('this.getLinks');
testUnsupported('this.getOCGs');
testUnsupported('this.getPageBox');
@@ -320,6 +326,7 @@ try {
testAddIcon();
testCalculateNow();
testGetAnnot();
+ testGetAnnots();
testGetField();
testGetIcon();
testGetNthFieldName();
diff --git a/testing/resources/javascript/document_methods_expected.txt b/testing/resources/javascript/document_methods_expected.txt
index 70a7481708..4a2c4d7ee6 100644
--- a/testing/resources/javascript/document_methods_expected.txt
+++ b/testing/resources/javascript/document_methods_expected.txt
@@ -32,9 +32,6 @@ Alert: PASS: this.extractPages(1, 2, "clams", [1, 2, 3]) = undefined
Alert: PASS: typeof this.getAnnot3D = function
Alert: PASS: this.getAnnot3D() = undefined
Alert: PASS: this.getAnnot3D(1, 2, "clams", [1, 2, 3]) = undefined
-Alert: PASS: typeof this.getAnnots = function
-Alert: PASS: this.getAnnots() = undefined
-Alert: PASS: this.getAnnots(1, 2, "clams", [1, 2, 3]) = undefined
Alert: PASS: typeof this.getLinks = function
Alert: PASS: this.getLinks() = undefined
Alert: PASS: this.getLinks(1, 2, "clams", [1, 2, 3]) = undefined
@@ -83,6 +80,7 @@ Alert: PASS: typeof this.getAnnot = function
Alert: PASS: this.getAnnot() threw error Document.getAnnot: Incorrect number of parameters passed to function.
Alert: PASS: this.getAnnot(0) threw error Document.getAnnot: Incorrect number of parameters passed to function.
Alert: PASS: this.getAnnot(0, "test", 0) threw error Document.getAnnot: Incorrect number of parameters passed to function.
+Alert: PASS: typeof this.getAnnots = function
Alert: PASS: typeof this.getField = function
Alert: PASS: this.getField() threw error Document.getField: Incorrect number of parameters passed to function.
Alert: PASS: typeof this.getIcon = function