Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: testing/resources/javascript/document_props.in

Issue 928573002: Test top-level Document JS properties. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add missing expected result file. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « samples/pdfium_test.cc ('k') | testing/resources/javascript/document_props_expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 {{header}}
2 {{object 1 0}} <<
3 /Type /Catalog
4 /Pages 2 0 R
5 /OpenAction 10 0 R
6 >>
7 endobj
8 {{object 2 0}} <<
9 /Type /Pages
10 /Count 4
11 /Kids [
12 3 0 R
13 4 0 R
14 5 0 R
15 6 0 R
16 ]
17 >>
18 endobj
19 % Page number 0.
20 {{object 3 0}} <<
21 /Type /Page
22 /Parent 2 0 R
23 /Resources <<
24 /Font <</F1 15 0 R>>
25 >>
26 /MediaBox [0 0 612 792]
27 >>
28 % Page number 1.
29 {{object 4 0}} <<
30 /Type /Page
31 /Parent 2 0 R
32 /Resources <<
33 /Font <</F1 15 0 R>>
34 >>
35 /MediaBox [0 0 612 792]
36 >>
37 % Page number 2.
38 {{object 5 0}} <<
39 /Type /Page
40 /Parent 2 0 R
41 /Resources <<
42 /Font <</F1 15 0 R>>
43 >>
44 /MediaBox [0 0 612 792]
45 >>
46 % Page number 3.
47 {{object 6 0}} <<
48 /Type /Page
49 /Parent 2 0 R
50 /Resources <<
51 /Font <</F1 15 0 R>>
52 >>
53 /MediaBox [0 0 612 792]
54 >>
55
56 % Info
57 {{object 9 0}} <<
58 /Author (Joe Random Author)
59 /Creator (Joe Random Creator)
60 >>
61 endobj
62 % OpenAction action
63 {{object 10 0}} <<
64 /Type /Action
65 /S /JavaScript
66 /JS 11 0 R
67 >>
68 endobj
69 % JS program to exexute
70 {{object 11 0}} <<
71 >>
72 stream
73 var document_props = [
74 'ADBE',
75 'author',
76 'baseURL',
77 'bookmarkRoot',
78 'calculate',
79 'Collab',
80 'creationDate',
81 'creator',
82 'delay',
83 'dirty',
84 'documentFileName',
85 'external',
86 'filesize',
87 'icons',
88 'info',
89 'keywords',
90 'layout',
91 'media',
92 'modDate',
93 'mouseX',
94 'mouseY',
95 'numFields',
96 'numPages',
97 'pageNum',
98 'pageWindowRect',
99 'path',
100 'producer',
101 'subject',
102 'title',
103 'zoom',
104 'zoomType',
105 ];
106
107 function testGetProps(props) {
108 try {
109 app.alert('*** Getting properties ***');
110 for (var i = 0; i < props.length; ++i) {
111 var expr1 = "this." + props[i];
112 var expr2 = "typeof " + expr1;
113 app.alert(expr1 + " is " + eval(expr2) + ' ' + eval(expr1));
114 }
115 } catch (e) {
116 app.alert("ERROR: " + e.toString());
117 }
118 }
119
120 function testSetProps(props) {
121 try {
122 app.alert('*** Setting properties ***');
123 for (var i = 0; i < props.length; ++i) {
124 var expr1 = "this." + props[i] + ' = 3;'
125 app.alert(expr1 + " yields " + eval(expr1));
126 }
127 } catch (e) {
128 app.alert("ERROR: " + e.toString());
129 }
130 }
131
132 testGetProps(document_props);
133 testSetProps(document_props);
134 testGetProps(document_props);
135 endstream
136 endobj
137 {{xref}}
138 trailer <<
139 /Root 1 0 R
140 /Info 9 0 R
141 >>
142 {{startxref}}
143 %%EOF
OLDNEW
« no previous file with comments | « samples/pdfium_test.cc ('k') | testing/resources/javascript/document_props_expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698