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

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

Issue 1317393003: Beef up app_props.in and tidy app.cpp (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Tidy app.cpp Created 5 years, 3 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
OLDNEW
1 {{header}} 1 {{header}}
2 {{object 1 0}} << 2 {{object 1 0}} <<
3 /Type /Catalog 3 /Type /Catalog
4 /Pages 2 0 R 4 /Pages 2 0 R
5 /OpenAction 10 0 R 5 /OpenAction 10 0 R
6 >> 6 >>
7 endobj 7 endobj
8 {{object 2 0}} << 8 {{object 2 0}} <<
9 /Type /Pages 9 /Type /Pages
10 /Count 1 10 /Count 4
11 /Kids [ 11 /Kids [
12 3 0 R 12 3 0 R
13 4 0 R
14 5 0 R
15 6 0 R
13 ] 16 ]
14 >> 17 >>
15 endobj 18 endobj
16 % Page number 0. 19 % Page number 0.
17 {{object 3 0}} << 20 {{object 3 0}} <<
18 /Type /Page 21 /Type /Page
19 /Parent 2 0 R 22 /Parent 2 0 R
20 /Resources << 23 /Resources <<
21 /Font <</F1 15 0 R>> 24 /Font <</F1 15 0 R>>
22 >> 25 >>
23 /Contents [21 0 R]
24 /MediaBox [0 0 612 792] 26 /MediaBox [0 0 612 792]
25 >> 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
26 % OpenAction action 62 % OpenAction action
27 {{object 10 0}} << 63 {{object 10 0}} <<
28 /Type /Action 64 /Type /Action
29 /S /JavaScript 65 /S /JavaScript
30 /JS 11 0 R 66 /JS 11 0 R
31 >> 67 >>
32 endobj 68 endobj
33 % JS program to exexute 69 % JS program to exexute
34 {{object 11 0}} << 70 {{object 11 0}} <<
35 >> 71 >>
36 stream 72 stream
37 app.alert("app.viewerType property value: " + app.viewerType); 73 var app_props = [
74 'activeDocs',
75 'calculate',
76 'formsVersion',
77 'fs',
78 'fullscreen',
79 'language',
80 'media',
81 'platform',
82 'runtimeHighlight',
83 'viewerType',
84 'viewerVariation',
85 'viewerVersion'
86 ];
87
88 function testGetProps(props) {
89 app.alert('*** Getting properties ***');
90 for (var i = 0; i < props.length; ++i) {
91 try {
92 var expr1 = "app." + props[i];
93 var expr2 = "typeof " + expr1;
94 app.alert(expr1 + " is " + eval(expr2) + ' ' + eval(expr1));
95 } catch (e) {
96 app.alert("ERROR: " + e.toString());
97 }
98 }
99 }
100
101 function testSetProps(props) {
102 app.alert('*** Setting properties ***');
103 for (var i = 0; i < props.length; ++i) {
104 try {
105 var expr1 = "app." + props[i] + ' = 3;'
106 app.alert(expr1 + " yields " + eval(expr1));
107 } catch (e) {
108 app.alert("ERROR: " + e.toString());
109 }
110 }
111 }
112
113 testGetProps(app_props);
114 testSetProps(app_props);
115 testGetProps(app_props);
38 endstream 116 endstream
39 endobj 117 endobj
40 {{xref}} 118 {{xref}}
41 trailer << 119 trailer <<
42 /Root 1 0 R 120 /Root 1 0 R
121 /Info 9 0 R
43 >> 122 >>
44 {{startxref}} 123 {{startxref}}
45 %%EOF 124 %%EOF
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698