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

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

Issue 963193003: Return error information from pdfium to JS. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Typedefs Created 5 years, 9 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 | « fpdfsdk/src/jsapi/fxjs_v8.cpp ('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
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 4 10 /Count 4
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 'pageWindowRect', 98 'pageWindowRect',
99 'path', 99 'path',
100 'producer', 100 'producer',
101 'subject', 101 'subject',
102 'title', 102 'title',
103 'zoom', 103 'zoom',
104 'zoomType', 104 'zoomType',
105 ]; 105 ];
106 106
107 function testGetProps(props) { 107 function testGetProps(props) {
108 try { 108 app.alert('*** Getting properties ***');
109 app.alert('*** Getting properties ***'); 109 for (var i = 0; i < props.length; ++i) {
110 for (var i = 0; i < props.length; ++i) { 110 try {
111 var expr1 = "this." + props[i]; 111 var expr1 = "this." + props[i];
112 var expr2 = "typeof " + expr1; 112 var expr2 = "typeof " + expr1;
113 app.alert(expr1 + " is " + eval(expr2) + ' ' + eval(expr1)); 113 app.alert(expr1 + " is " + eval(expr2) + ' ' + eval(expr1));
114 } catch (e) {
115 app.alert("ERROR: " + e.toString());
114 } 116 }
115 } catch (e) {
116 app.alert("ERROR: " + e.toString());
117 } 117 }
118 } 118 }
119 119
120 function testSetProps(props) { 120 function testSetProps(props) {
121 try { 121 app.alert('*** Setting properties ***');
122 app.alert('*** Setting properties ***'); 122 for (var i = 0; i < props.length; ++i) {
123 for (var i = 0; i < props.length; ++i) { 123 try {
124 var expr1 = "this." + props[i] + ' = 3;' 124 var expr1 = "this." + props[i] + ' = 3;'
125 app.alert(expr1 + " yields " + eval(expr1)); 125 app.alert(expr1 + " yields " + eval(expr1));
126 } catch (e) {
127 app.alert("ERROR: " + e.toString());
126 } 128 }
127 } catch (e) {
128 app.alert("ERROR: " + e.toString());
129 } 129 }
130 } 130 }
131 131
132 testGetProps(document_props); 132 testGetProps(document_props);
133 testSetProps(document_props); 133 testSetProps(document_props);
134 testGetProps(document_props); 134 testGetProps(document_props);
135 endstream 135 endstream
136 endobj 136 endobj
137 {{xref}} 137 {{xref}}
138 trailer << 138 trailer <<
139 /Root 1 0 R 139 /Root 1 0 R
140 /Info 9 0 R 140 /Info 9 0 R
141 >> 141 >>
142 {{startxref}} 142 {{startxref}}
143 %%EOF 143 %%EOF
OLDNEW
« no previous file with comments | « fpdfsdk/src/jsapi/fxjs_v8.cpp ('k') | testing/resources/javascript/document_props_expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698