xref: /aosp_15_r20/external/pdfium/testing/resources/javascript/document_methods.in (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1*3ac0a46fSAndroid Build Coastguard Worker{{header}}
2*3ac0a46fSAndroid Build Coastguard Worker{{object 1 0}} <<
3*3ac0a46fSAndroid Build Coastguard Worker  /Type /Catalog
4*3ac0a46fSAndroid Build Coastguard Worker  /Pages 2 0 R
5*3ac0a46fSAndroid Build Coastguard Worker  /OpenAction 10 0 R
6*3ac0a46fSAndroid Build Coastguard Worker>>
7*3ac0a46fSAndroid Build Coastguard Workerendobj
8*3ac0a46fSAndroid Build Coastguard Worker{{object 2 0}} <<
9*3ac0a46fSAndroid Build Coastguard Worker  /Type /Pages
10*3ac0a46fSAndroid Build Coastguard Worker  /Count 4
11*3ac0a46fSAndroid Build Coastguard Worker  /Kids [
12*3ac0a46fSAndroid Build Coastguard Worker    3 0 R
13*3ac0a46fSAndroid Build Coastguard Worker    4 0 R
14*3ac0a46fSAndroid Build Coastguard Worker    5 0 R
15*3ac0a46fSAndroid Build Coastguard Worker    6 0 R
16*3ac0a46fSAndroid Build Coastguard Worker  ]
17*3ac0a46fSAndroid Build Coastguard Worker>>
18*3ac0a46fSAndroid Build Coastguard Workerendobj
19*3ac0a46fSAndroid Build Coastguard Worker% Page number 0.
20*3ac0a46fSAndroid Build Coastguard Worker{{object 3 0}} <<
21*3ac0a46fSAndroid Build Coastguard Worker  /Type /Page
22*3ac0a46fSAndroid Build Coastguard Worker  /Parent 2 0 R
23*3ac0a46fSAndroid Build Coastguard Worker  /Resources <<
24*3ac0a46fSAndroid Build Coastguard Worker    /Font <</F1 15 0 R>>
25*3ac0a46fSAndroid Build Coastguard Worker  >>
26*3ac0a46fSAndroid Build Coastguard Worker  /MediaBox [0 0 612 792]
27*3ac0a46fSAndroid Build Coastguard Worker  /Contents 8 0 R
28*3ac0a46fSAndroid Build Coastguard Worker>>
29*3ac0a46fSAndroid Build Coastguard Workerendobj
30*3ac0a46fSAndroid Build Coastguard Worker% Page number 1.
31*3ac0a46fSAndroid Build Coastguard Worker{{object 4 0}} <<
32*3ac0a46fSAndroid Build Coastguard Worker  /Type /Page
33*3ac0a46fSAndroid Build Coastguard Worker  /Parent 2 0 R
34*3ac0a46fSAndroid Build Coastguard Worker  /Resources <<
35*3ac0a46fSAndroid Build Coastguard Worker    /Font <</F1 15 0 R>>
36*3ac0a46fSAndroid Build Coastguard Worker  >>
37*3ac0a46fSAndroid Build Coastguard Worker  /MediaBox [0 0 612 792]
38*3ac0a46fSAndroid Build Coastguard Worker>>
39*3ac0a46fSAndroid Build Coastguard Workerendobj
40*3ac0a46fSAndroid Build Coastguard Worker% Page number 2.
41*3ac0a46fSAndroid Build Coastguard Worker{{object 5 0}} <<
42*3ac0a46fSAndroid Build Coastguard Worker  /Type /Page
43*3ac0a46fSAndroid Build Coastguard Worker  /Parent 2 0 R
44*3ac0a46fSAndroid Build Coastguard Worker  /Resources <<
45*3ac0a46fSAndroid Build Coastguard Worker    /Font <</F1 15 0 R>>
46*3ac0a46fSAndroid Build Coastguard Worker  >>
47*3ac0a46fSAndroid Build Coastguard Worker  /MediaBox [0 0 612 792]
48*3ac0a46fSAndroid Build Coastguard Worker>>
49*3ac0a46fSAndroid Build Coastguard Workerendobj
50*3ac0a46fSAndroid Build Coastguard Worker% Page number 3.
51*3ac0a46fSAndroid Build Coastguard Worker{{object 6 0}} <<
52*3ac0a46fSAndroid Build Coastguard Worker  /Type /Page
53*3ac0a46fSAndroid Build Coastguard Worker  /Parent 2 0 R
54*3ac0a46fSAndroid Build Coastguard Worker  /Resources <<
55*3ac0a46fSAndroid Build Coastguard Worker    /Font <</F1 15 0 R>>
56*3ac0a46fSAndroid Build Coastguard Worker  >>
57*3ac0a46fSAndroid Build Coastguard Worker  /MediaBox [0 0 612 792]
58*3ac0a46fSAndroid Build Coastguard Worker>>
59*3ac0a46fSAndroid Build Coastguard Workerendobj
60*3ac0a46fSAndroid Build Coastguard Worker% Contents of the page.
61*3ac0a46fSAndroid Build Coastguard Worker{{object 8 0}} <<
62*3ac0a46fSAndroid Build Coastguard Worker  {{streamlen}}
63*3ac0a46fSAndroid Build Coastguard Worker>>
64*3ac0a46fSAndroid Build Coastguard Workerstream
65*3ac0a46fSAndroid Build Coastguard WorkerBT
66*3ac0a46fSAndroid Build Coastguard Worker20 50 Td
67*3ac0a46fSAndroid Build Coastguard Worker/F1 12 Tf
68*3ac0a46fSAndroid Build Coastguard Worker(Hello, world!) Tj
69*3ac0a46fSAndroid Build Coastguard Worker0 50 Td
70*3ac0a46fSAndroid Build Coastguard Workerendstream
71*3ac0a46fSAndroid Build Coastguard Workerendobj
72*3ac0a46fSAndroid Build Coastguard Worker% Info
73*3ac0a46fSAndroid Build Coastguard Worker{{object 9 0}} <<
74*3ac0a46fSAndroid Build Coastguard Worker  /Author (Joe Random Author)
75*3ac0a46fSAndroid Build Coastguard Worker  /Creator (Joe Random Creator)
76*3ac0a46fSAndroid Build Coastguard Worker>>
77*3ac0a46fSAndroid Build Coastguard Workerendobj
78*3ac0a46fSAndroid Build Coastguard Worker% OpenAction action
79*3ac0a46fSAndroid Build Coastguard Worker{{object 10 0}} <<
80*3ac0a46fSAndroid Build Coastguard Worker  /Type /Action
81*3ac0a46fSAndroid Build Coastguard Worker  /S /JavaScript
82*3ac0a46fSAndroid Build Coastguard Worker  /JS 11 0 R
83*3ac0a46fSAndroid Build Coastguard Worker>>
84*3ac0a46fSAndroid Build Coastguard Workerendobj
85*3ac0a46fSAndroid Build Coastguard Worker% JS program to execute
86*3ac0a46fSAndroid Build Coastguard Worker{{object 11 0}} <<
87*3ac0a46fSAndroid Build Coastguard Worker  {{streamlen}}
88*3ac0a46fSAndroid Build Coastguard Worker>>
89*3ac0a46fSAndroid Build Coastguard Workerstream
90*3ac0a46fSAndroid Build Coastguard Worker{{include expect.js}}
91*3ac0a46fSAndroid Build Coastguard Worker
92*3ac0a46fSAndroid Build Coastguard Worker// "Unsupported" methods are present in the document object, but not
93*3ac0a46fSAndroid Build Coastguard Worker// implemented. They always return |undefined| regardless of arguments.
94*3ac0a46fSAndroid Build Coastguard Workerfunction testUnsupported(str) {
95*3ac0a46fSAndroid Build Coastguard Worker  expect('typeof ' + str, 'function');
96*3ac0a46fSAndroid Build Coastguard Worker  expect(str + '()', undefined);
97*3ac0a46fSAndroid Build Coastguard Worker  expect(str + '(1, 2, "clams", [1, 2, 3])', undefined);
98*3ac0a46fSAndroid Build Coastguard Worker}
99*3ac0a46fSAndroid Build Coastguard Worker
100*3ac0a46fSAndroid Build Coastguard Workerfunction testAddIcon() {
101*3ac0a46fSAndroid Build Coastguard Worker   // Method is present.
102*3ac0a46fSAndroid Build Coastguard Worker   expect('typeof this.addIcon', 'function');
103*3ac0a46fSAndroid Build Coastguard Worker
104*3ac0a46fSAndroid Build Coastguard Worker   // Method takes exactly two arguments.
105*3ac0a46fSAndroid Build Coastguard Worker   expectError('this.addIcon()');
106*3ac0a46fSAndroid Build Coastguard Worker   expectError('this.addIcon(1)');
107*3ac0a46fSAndroid Build Coastguard Worker   expectError('this.addIcon(1, 2, 3)');
108*3ac0a46fSAndroid Build Coastguard Worker
109*3ac0a46fSAndroid Build Coastguard Worker   // Second argument must actually be an icon.
110*3ac0a46fSAndroid Build Coastguard Worker   expectError('this.addIcon("myicon", 3)');
111*3ac0a46fSAndroid Build Coastguard Worker   expectError('this.addIcon("myicon", undefined)');
112*3ac0a46fSAndroid Build Coastguard Worker
113*3ac0a46fSAndroid Build Coastguard Worker   // TODO(tsepez): test success cases.
114*3ac0a46fSAndroid Build Coastguard Worker}
115*3ac0a46fSAndroid Build Coastguard Worker
116*3ac0a46fSAndroid Build Coastguard Workerfunction testCalculateNow() {
117*3ac0a46fSAndroid Build Coastguard Worker   // Method is present.
118*3ac0a46fSAndroid Build Coastguard Worker   expect('typeof this.calculateNow', 'function');
119*3ac0a46fSAndroid Build Coastguard Worker
120*3ac0a46fSAndroid Build Coastguard Worker   // TODO(tsepez): test with no permissions.
121*3ac0a46fSAndroid Build Coastguard Worker
122*3ac0a46fSAndroid Build Coastguard Worker   expect('this.calculateNow()', undefined)
123*3ac0a46fSAndroid Build Coastguard Worker}
124*3ac0a46fSAndroid Build Coastguard Worker
125*3ac0a46fSAndroid Build Coastguard Workerfunction testGetAnnot() {
126*3ac0a46fSAndroid Build Coastguard Worker   // Method is present.
127*3ac0a46fSAndroid Build Coastguard Worker   expect('typeof this.getAnnot', 'function');
128*3ac0a46fSAndroid Build Coastguard Worker
129*3ac0a46fSAndroid Build Coastguard Worker   // Method needs two arguments.
130*3ac0a46fSAndroid Build Coastguard Worker   expectError('this.getAnnot()');
131*3ac0a46fSAndroid Build Coastguard Worker   expectError('this.getAnnot(0)');
132*3ac0a46fSAndroid Build Coastguard Worker   expectError('this.getAnnot(0, "test", 0)');
133*3ac0a46fSAndroid Build Coastguard Worker
134*3ac0a46fSAndroid Build Coastguard Worker   // TODO(tonikitoo): test success cases.
135*3ac0a46fSAndroid Build Coastguard Worker}
136*3ac0a46fSAndroid Build Coastguard Worker
137*3ac0a46fSAndroid Build Coastguard Workerfunction testGetAnnots() {
138*3ac0a46fSAndroid Build Coastguard Worker   // Method is present.
139*3ac0a46fSAndroid Build Coastguard Worker   expect('typeof this.getAnnots', 'function');
140*3ac0a46fSAndroid Build Coastguard Worker
141*3ac0a46fSAndroid Build Coastguard Worker   // TODO(tonikitoo): test success cases.
142*3ac0a46fSAndroid Build Coastguard Worker}
143*3ac0a46fSAndroid Build Coastguard Worker
144*3ac0a46fSAndroid Build Coastguard Workerfunction testGetField() {
145*3ac0a46fSAndroid Build Coastguard Worker   // Method is present.
146*3ac0a46fSAndroid Build Coastguard Worker   expect('typeof this.getField', 'function');
147*3ac0a46fSAndroid Build Coastguard Worker
148*3ac0a46fSAndroid Build Coastguard Worker   // Method needs at least one argument.
149*3ac0a46fSAndroid Build Coastguard Worker   expectError('this.getField()');
150*3ac0a46fSAndroid Build Coastguard Worker
151*3ac0a46fSAndroid Build Coastguard Worker   // TODO(tsepez): test success cases.
152*3ac0a46fSAndroid Build Coastguard Worker}
153*3ac0a46fSAndroid Build Coastguard Worker
154*3ac0a46fSAndroid Build Coastguard Workerfunction testGetIcon() {
155*3ac0a46fSAndroid Build Coastguard Worker   // Method is present.
156*3ac0a46fSAndroid Build Coastguard Worker   expect('typeof this.getIcon', 'function');
157*3ac0a46fSAndroid Build Coastguard Worker
158*3ac0a46fSAndroid Build Coastguard Worker   // Method needs exactly one argument.
159*3ac0a46fSAndroid Build Coastguard Worker   expectError('this.getIcon()');
160*3ac0a46fSAndroid Build Coastguard Worker   expectError('this.getIcon(1, 2)');
161*3ac0a46fSAndroid Build Coastguard Worker
162*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): test success cases.
163*3ac0a46fSAndroid Build Coastguard Worker}
164*3ac0a46fSAndroid Build Coastguard Worker
165*3ac0a46fSAndroid Build Coastguard Workerfunction testGetNthFieldName() {
166*3ac0a46fSAndroid Build Coastguard Worker  // Method is present.
167*3ac0a46fSAndroid Build Coastguard Worker  expect('typeof this.getNthFieldName', 'function');
168*3ac0a46fSAndroid Build Coastguard Worker
169*3ac0a46fSAndroid Build Coastguard Worker  // Method needs at least one argument.
170*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.getNthFieldName()');
171*3ac0a46fSAndroid Build Coastguard Worker
172*3ac0a46fSAndroid Build Coastguard Worker  // Argument can not be negative.
173*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.getNthFieldName(-1)');
174*3ac0a46fSAndroid Build Coastguard Worker
175*3ac0a46fSAndroid Build Coastguard Worker  // Argument can not be huge.
176*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.getNthFieldName(400000)');
177*3ac0a46fSAndroid Build Coastguard Worker
178*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): add field object so this case works.
179*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.getNthFieldName(0)');
180*3ac0a46fSAndroid Build Coastguard Worker}
181*3ac0a46fSAndroid Build Coastguard Worker
182*3ac0a46fSAndroid Build Coastguard Workerfunction testGetPageNthWord() {
183*3ac0a46fSAndroid Build Coastguard Worker  // Method is present.
184*3ac0a46fSAndroid Build Coastguard Worker  expect('typeof this.getPageNthWord', 'function');
185*3ac0a46fSAndroid Build Coastguard Worker
186*3ac0a46fSAndroid Build Coastguard Worker  // Method accepts any number of parameters.
187*3ac0a46fSAndroid Build Coastguard Worker  expect('this.getPageNthWord(0, 0, true, "clams", [1, 2])', 'Hello,');
188*3ac0a46fSAndroid Build Coastguard Worker
189*3ac0a46fSAndroid Build Coastguard Worker  // Arguments can't be negative or out of range.
190*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.getPageNthWord(-1, 0, true)');
191*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.getPageNthWord(6, 0, true)');
192*3ac0a46fSAndroid Build Coastguard Worker
193*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): test with no permissions.
194*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): test success cases.
195*3ac0a46fSAndroid Build Coastguard Worker}
196*3ac0a46fSAndroid Build Coastguard Worker
197*3ac0a46fSAndroid Build Coastguard Workerfunction testGetPageNthWordQuads() {
198*3ac0a46fSAndroid Build Coastguard Worker   // Method is present.
199*3ac0a46fSAndroid Build Coastguard Worker   expect('typeof this.getPageNthWordQuads', 'function');
200*3ac0a46fSAndroid Build Coastguard Worker
201*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): test with no permissions.
202*3ac0a46fSAndroid Build Coastguard Worker
203*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.getPageNthWordQuads()');
204*3ac0a46fSAndroid Build Coastguard Worker}
205*3ac0a46fSAndroid Build Coastguard Worker
206*3ac0a46fSAndroid Build Coastguard Workerfunction testGetPageNumWords() {
207*3ac0a46fSAndroid Build Coastguard Worker   // Method is present.
208*3ac0a46fSAndroid Build Coastguard Worker   expect('typeof this.getPageNumWords', 'function');
209*3ac0a46fSAndroid Build Coastguard Worker
210*3ac0a46fSAndroid Build Coastguard Worker  // Method accepts any number of parameters.
211*3ac0a46fSAndroid Build Coastguard Worker  expect('this.getPageNumWords(0, "clams", [1, 2])', 2);
212*3ac0a46fSAndroid Build Coastguard Worker
213*3ac0a46fSAndroid Build Coastguard Worker  // Arguments can't be negative or out of range.
214*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.getPageNumWords(-1)');
215*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.getPageNumWords(6)');
216*3ac0a46fSAndroid Build Coastguard Worker
217*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): test with no permissions.
218*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): test success cases.
219*3ac0a46fSAndroid Build Coastguard Worker}
220*3ac0a46fSAndroid Build Coastguard Worker
221*3ac0a46fSAndroid Build Coastguard Workerfunction testGetPrintParams() {
222*3ac0a46fSAndroid Build Coastguard Worker  // Method is present.
223*3ac0a46fSAndroid Build Coastguard Worker  expect('typeof this.getPrintParams', 'function');
224*3ac0a46fSAndroid Build Coastguard Worker
225*3ac0a46fSAndroid Build Coastguard Worker  // Method always returns in error.
226*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.getPrintParams()');
227*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.getPrintParams(42)');
228*3ac0a46fSAndroid Build Coastguard Worker}
229*3ac0a46fSAndroid Build Coastguard Worker
230*3ac0a46fSAndroid Build Coastguard Workerfunction testGotoNamedDest() {
231*3ac0a46fSAndroid Build Coastguard Worker  // Method is present.
232*3ac0a46fSAndroid Build Coastguard Worker  expect('typeof this.gotoNamedDest', 'function');
233*3ac0a46fSAndroid Build Coastguard Worker
234*3ac0a46fSAndroid Build Coastguard Worker  // Method needs exactly one argument.
235*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.gotoNamedDest()');
236*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.gotoNamedDest(1, 2)');
237*3ac0a46fSAndroid Build Coastguard Worker
238*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): add actual named dest matching this.
239*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.gotoNamedDest("chicago")');
240*3ac0a46fSAndroid Build Coastguard Worker}
241*3ac0a46fSAndroid Build Coastguard Worker
242*3ac0a46fSAndroid Build Coastguard Workerfunction testMailDoc() {
243*3ac0a46fSAndroid Build Coastguard Worker  // Method is present.
244*3ac0a46fSAndroid Build Coastguard Worker  expect('typeof this.mailDoc', 'function');
245*3ac0a46fSAndroid Build Coastguard Worker
246*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): test with no permissions.
247*3ac0a46fSAndroid Build Coastguard Worker
248*3ac0a46fSAndroid Build Coastguard Worker  // Success cases.
249*3ac0a46fSAndroid Build Coastguard Worker  expect('this.mailDoc()', undefined);
250*3ac0a46fSAndroid Build Coastguard Worker  expect('this.mailDoc(false, "[email protected]", "[email protected]", ' +
251*3ac0a46fSAndroid Build Coastguard Worker             '"[email protected]", "Lottery Winner", "You won the lottery!")',
252*3ac0a46fSAndroid Build Coastguard Worker         undefined);
253*3ac0a46fSAndroid Build Coastguard Worker  expect('this.mailDoc({})', undefined);
254*3ac0a46fSAndroid Build Coastguard Worker  expect('this.mailDoc({"bUI": false, "cTo": "[email protected]", ' +
255*3ac0a46fSAndroid Build Coastguard Worker            '"cCc": "[email protected]", "cBcc": "[email protected]", ' +
256*3ac0a46fSAndroid Build Coastguard Worker            '"cSubject": "LotteryWinner", "cMsg": "You won the lottery!", ' +
257*3ac0a46fSAndroid Build Coastguard Worker            '"bogus": "yes"})',
258*3ac0a46fSAndroid Build Coastguard Worker         undefined);
259*3ac0a46fSAndroid Build Coastguard Worker}
260*3ac0a46fSAndroid Build Coastguard Worker
261*3ac0a46fSAndroid Build Coastguard Workerfunction testMailForm() {
262*3ac0a46fSAndroid Build Coastguard Worker   // Method is present.
263*3ac0a46fSAndroid Build Coastguard Worker   expect('typeof this.mailForm', 'function');
264*3ac0a46fSAndroid Build Coastguard Worker
265*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): test with no permissions.
266*3ac0a46fSAndroid Build Coastguard Worker
267*3ac0a46fSAndroid Build Coastguard Worker  // Success cases.
268*3ac0a46fSAndroid Build Coastguard Worker  expect('this.mailForm()', undefined);
269*3ac0a46fSAndroid Build Coastguard Worker  expect('this.mailForm(false, "[email protected]", "[email protected]", ' +
270*3ac0a46fSAndroid Build Coastguard Worker             '"[email protected]", "Lottery Winner", "You won the lottery!")',
271*3ac0a46fSAndroid Build Coastguard Worker         undefined);
272*3ac0a46fSAndroid Build Coastguard Worker  expect('this.mailForm({})', undefined);
273*3ac0a46fSAndroid Build Coastguard Worker  expect('this.mailForm({"bUI": false, "cTo": "[email protected]", ' +
274*3ac0a46fSAndroid Build Coastguard Worker            '"cCc": "[email protected]", "cBcc": "[email protected]", ' +
275*3ac0a46fSAndroid Build Coastguard Worker            '"cSubject": "LotteryWinner", "cMsg": "You won the lottery!", ' +
276*3ac0a46fSAndroid Build Coastguard Worker            '"bogus": "yes"})',
277*3ac0a46fSAndroid Build Coastguard Worker         undefined);
278*3ac0a46fSAndroid Build Coastguard Worker}
279*3ac0a46fSAndroid Build Coastguard Worker
280*3ac0a46fSAndroid Build Coastguard Workerfunction testPrint() {
281*3ac0a46fSAndroid Build Coastguard Worker  // Method is present.
282*3ac0a46fSAndroid Build Coastguard Worker  expect('typeof this.print', 'function');
283*3ac0a46fSAndroid Build Coastguard Worker
284*3ac0a46fSAndroid Build Coastguard Worker  // Successful only when invoked by a user gesture.
285*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.print()', undefined);
286*3ac0a46fSAndroid Build Coastguard Worker}
287*3ac0a46fSAndroid Build Coastguard Worker
288*3ac0a46fSAndroid Build Coastguard Workerfunction testRemoveField() {
289*3ac0a46fSAndroid Build Coastguard Worker  // Method is present.
290*3ac0a46fSAndroid Build Coastguard Worker  expect('typeof this.removeField', 'function');
291*3ac0a46fSAndroid Build Coastguard Worker
292*3ac0a46fSAndroid Build Coastguard Worker  // Method requires at least one argument.
293*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.removeField()');
294*3ac0a46fSAndroid Build Coastguard Worker
295*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): test with no permissions.
296*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): test success cases.
297*3ac0a46fSAndroid Build Coastguard Worker}
298*3ac0a46fSAndroid Build Coastguard Worker
299*3ac0a46fSAndroid Build Coastguard Workerfunction testResetForm() {
300*3ac0a46fSAndroid Build Coastguard Worker   // Method is present.
301*3ac0a46fSAndroid Build Coastguard Worker   expect('typeof this.resetForm', 'function');
302*3ac0a46fSAndroid Build Coastguard Worker
303*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): test with no permissions.
304*3ac0a46fSAndroid Build Coastguard Worker
305*3ac0a46fSAndroid Build Coastguard Worker  // TODO(tsepez): Add form to document to match these arguments.
306*3ac0a46fSAndroid Build Coastguard Worker  expect('this.resetForm()', undefined);
307*3ac0a46fSAndroid Build Coastguard Worker  expect('this.resetForm("myform")', undefined);
308*3ac0a46fSAndroid Build Coastguard Worker}
309*3ac0a46fSAndroid Build Coastguard Worker
310*3ac0a46fSAndroid Build Coastguard Workerfunction testSubmitForm() {
311*3ac0a46fSAndroid Build Coastguard Worker   // Method is present.
312*3ac0a46fSAndroid Build Coastguard Worker   expect('typeof this.submitForm', 'function');
313*3ac0a46fSAndroid Build Coastguard Worker
314*3ac0a46fSAndroid Build Coastguard Worker  // Method requires at least one argument.
315*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.submitForm()');
316*3ac0a46fSAndroid Build Coastguard Worker
317*3ac0a46fSAndroid Build Coastguard Worker  // Successful only when invoked by a user gesture.
318*3ac0a46fSAndroid Build Coastguard Worker  expectError('this.submitForm("myform", true, true, ["name", "age"])');
319*3ac0a46fSAndroid Build Coastguard Worker}
320*3ac0a46fSAndroid Build Coastguard Worker
321*3ac0a46fSAndroid Build Coastguard Workertry {
322*3ac0a46fSAndroid Build Coastguard Worker  app.alert('*** Testing Unsupported Methods ***');
323*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.addAnnot');
324*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.addField');
325*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.addLink');
326*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.closeDoc');
327*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.createDataObject');
328*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.deletePages');
329*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.exportAsFDF');
330*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.exportAsText');
331*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.exportAsXFDF');
332*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.extractPages');
333*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.getAnnot3D');
334*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.getAnnots3D');
335*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.getLinks');
336*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.getOCGs');
337*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.getPageBox');
338*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.getURL');
339*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.importAnFDF');
340*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.importAnXFDF');
341*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.importTextData');
342*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.insertPages');
343*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.removeIcon');
344*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.replacePages');
345*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.saveAs');
346*3ac0a46fSAndroid Build Coastguard Worker  testUnsupported('this.syncAnnotScan');
347*3ac0a46fSAndroid Build Coastguard Worker
348*3ac0a46fSAndroid Build Coastguard Worker  app.alert('*** Testing Supported Methods ***');
349*3ac0a46fSAndroid Build Coastguard Worker  testAddIcon();
350*3ac0a46fSAndroid Build Coastguard Worker  testCalculateNow();
351*3ac0a46fSAndroid Build Coastguard Worker  testGetAnnot();
352*3ac0a46fSAndroid Build Coastguard Worker  testGetAnnots();
353*3ac0a46fSAndroid Build Coastguard Worker  testGetField();
354*3ac0a46fSAndroid Build Coastguard Worker  testGetIcon();
355*3ac0a46fSAndroid Build Coastguard Worker  testGetNthFieldName();
356*3ac0a46fSAndroid Build Coastguard Worker  testGetPageNthWord();
357*3ac0a46fSAndroid Build Coastguard Worker  testGetPageNthWordQuads();
358*3ac0a46fSAndroid Build Coastguard Worker  testGetPageNumWords();
359*3ac0a46fSAndroid Build Coastguard Worker  testGetPrintParams();
360*3ac0a46fSAndroid Build Coastguard Worker  testGotoNamedDest();
361*3ac0a46fSAndroid Build Coastguard Worker  testMailDoc();
362*3ac0a46fSAndroid Build Coastguard Worker  testMailForm();
363*3ac0a46fSAndroid Build Coastguard Worker  testPrint();
364*3ac0a46fSAndroid Build Coastguard Worker  testRemoveField();
365*3ac0a46fSAndroid Build Coastguard Worker  testResetForm();
366*3ac0a46fSAndroid Build Coastguard Worker  testSubmitForm();
367*3ac0a46fSAndroid Build Coastguard Worker} catch (e) {
368*3ac0a46fSAndroid Build Coastguard Worker  app.alert('FATAL: ' + e.toString());
369*3ac0a46fSAndroid Build Coastguard Worker}
370*3ac0a46fSAndroid Build Coastguard Workerendstream
371*3ac0a46fSAndroid Build Coastguard Workerendobj
372*3ac0a46fSAndroid Build Coastguard Worker{{xref}}
373*3ac0a46fSAndroid Build Coastguard Workertrailer <<
374*3ac0a46fSAndroid Build Coastguard Worker  /Root 1 0 R
375*3ac0a46fSAndroid Build Coastguard Worker  /Info 9 0 R
376*3ac0a46fSAndroid Build Coastguard Worker>>
377*3ac0a46fSAndroid Build Coastguard Worker{{startxref}}
378*3ac0a46fSAndroid Build Coastguard Worker%%EOF
379