summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-07-24 11:38:31 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-07-24 19:42:23 +0000
commitbfa2a97ca9f5026ceb8e8c2ce23cfc3c3e8b38a1 (patch)
treea97d91eb40560bae12721841a8fa6985aab42d8f /testing
parent585f4f0828d2bef2ea132a19e28f21af67bb6bdd (diff)
downloadpdfium-bfa2a97ca9f5026ceb8e8c2ce23cfc3c3e8b38a1.tar.xz
Observe Annot destruction in CPDFSDK_PageView::DeleteAnnot
Run test XFA-Only, since that's where the issue occurs, and the textual output is different for non-xfa. Fix a few lifetime issue in pdfium_test.cc unearthed by this test (doc must outlive pages now held in formfill info). Bug: 735912 Change-Id: Icc9e6a967c32ece67d897117896c973bb16a1515 Reviewed-on: https://pdfium-review.googlesource.com/8510 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'testing')
-rw-r--r--testing/SUPPRESSIONS22
-rw-r--r--testing/resources/javascript/bug_735912.in115
-rw-r--r--testing/resources/javascript/bug_735912_expected.txt2
3 files changed, 131 insertions, 8 deletions
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index 8389289589..feb862e3b1 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -286,13 +286,8 @@ zh_file1.pdf mac * *
zh_function_list.pdf mac * *
zh_shared_document.pdf mac * *
-bug_492.in * nov8 *
-bug_679643.in * * noxfa
-bug_679642.in * * noxfa
-
-#
# TODO(hnakashima): These might never have been run. Go over them and fix.
-#
+
FRC_8.5_E&X.pdf * * *
FRC_8.5_O&PO_GoToE.pdf * * *
FRC_8.5_OpenAction&O_URI.pdf * * *
@@ -300,9 +295,8 @@ FRC_8.5_PC&C_GoToE_T_T.pdf * * *
FRC_8.5_PC_GoToE_T_R&P&A.pdf * * *
FRC_8.5_PO_GoToE_T_R&N.pdf * * *
-#
# xfa_specific
-#
+
Choose.pdf * * *
data_binding.pdf * * *
Date_FormCale.pdf * * *
@@ -315,3 +309,15 @@ TimeField.pdf win,linux * *
Test_CheckBox.pdf * * *
Test_DateField_locale_zh_HK.pdf mac,win * *
+#
+# JavaScript tests
+#
+bug_679642.in * * noxfa
+bug_679643.in * * noxfa
+bug_735912.in * * noxfa
+
+#
+# Pixel tests
+#
+bug_492.in * nov8 *
+
diff --git a/testing/resources/javascript/bug_735912.in b/testing/resources/javascript/bug_735912.in
new file mode 100644
index 0000000000..7f42d1b7c2
--- /dev/null
+++ b/testing/resources/javascript/bug_735912.in
@@ -0,0 +1,115 @@
+{{header}}
+{{object 1 0}} <<
+ /Type /Catalog
+ /Pages 2 0 R
+ /AcroForm 4 0 R
+ /OpenAction 30 0 R
+>>
+endobj
+{{object 2 0}} <<
+ /Type /Pages
+ /Count 1
+ /Kids [
+ 3 0 R
+ ]
+>>
+endobj
+% Page number 0.
+{{object 3 0}} <<
+ /Type /Page
+ /Parent 2 0 R
+ /Annots [
+ 8 0 R
+ ]
+ /AA << /C 36 0 R >>
+>>
+endobj
+% Forms
+{{object 4 0}} <<
+ /XFA [
+ (xdp:xdp) 43 0 R
+ (form) 49 0 R
+ (</xdp:xdp>) 50 0 R
+ ]
+ /Fields [
+ 8 0 R
+ ]
+>>
+endobj
+% Fields
+{{object 8 0}} <<
+ /FT /Tx
+ /T (MyField)
+ /Type /Annot
+ /Subtype /Widget
+ /Rect [100 300 500 400]
+ /AA << /Bl 34 0 R >>
+>>
+endobj
+% JS Action
+{{object 30 0}} <<
+ /Type /Action
+ /S /JavaScript
+ /JS 31 0 R
+>>
+endobj
+% JS program to exexute
+{{object 31 0}} <<
+>>
+stream
+this.getField("MyField").setFocus();
+app.alert("focused");
+endstream
+endobj
+% Lost Focus AAction MyField
+{{object 34 0}} <<
+ /Type /Action
+ /S /JavaScript
+ /JS 35 0 R
+>>
+endobj
+% JS program to exexute
+{{object 35 0}} <<
+>>
+stream
+this.removeField("MyField");
+app.alert("removed");
+endstream
+endobj
+% Closing Page 0
+{{object 36 0}} <<
+ /Type /Action
+ /S /JavaScript
+ /JS 37 0 R
+>>
+endobj
+% JS program to exexute
+{{object 37 0}} <<
+>>
+stream
+this.removeField("MyField");
+endstream
+endobj
+{{object 43 0}} <<
+>>stream
+<?xml version="1.0" encoding="UTF-8"?>
+<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">
+endstream
+endobj
+{{object 49 0}} <<
+>>stream
+<config></config>
+<template></template>
+endstream
+endobj
+{{object 50 0}} <<
+>>stream
+</xdp:xdp>
+endstream
+endobj
+{{xref}}
+trailer <<
+ /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/javascript/bug_735912_expected.txt b/testing/resources/javascript/bug_735912_expected.txt
new file mode 100644
index 0000000000..7d0f42f517
--- /dev/null
+++ b/testing/resources/javascript/bug_735912_expected.txt
@@ -0,0 +1,2 @@
+Alert: removed
+Alert: focused