OLD | NEW |
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
3 <html> | 3 <html> |
4 <!-- | 4 <!-- |
5 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 5 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
6 Use of this source code is governed by a BSD-style license that can be | 6 Use of this source code is governed by a BSD-style license that can be |
7 found in the LICENSE file. | 7 found in the LICENSE file. |
8 --> | 8 --> |
9 <head> | 9 <head> |
10 <META HTTP-EQUIV="Pragma" CONTENT="no-cache" /> | 10 <META HTTP-EQUIV="Pragma" CONTENT="no-cache" /> |
(...skipping 26 matching lines...) Expand all Loading... |
37 return prefix + 'could not load nexe url.'; | 37 return prefix + 'could not load nexe url.'; |
38 } else { | 38 } else { |
39 /* PP_ERROR_FAILED */ | 39 /* PP_ERROR_FAILED */ |
40 return prefix + 'PnaclCoordinator: pexe load failed (pp_error=-2).'; | 40 return prefix + 'PnaclCoordinator: pexe load failed (pp_error=-2).'; |
41 } | 41 } |
42 } | 42 } |
43 | 43 |
44 function declareTests(tester) { | 44 function declareTests(tester) { |
45 var test_args = getTestArguments({'is_pnacl': '0'}); | 45 var test_args = getTestArguments({'is_pnacl': '0'}); |
46 var is_pnacl = parseInt(test_args['is_pnacl']); | 46 var is_pnacl = parseInt(test_args['is_pnacl']); |
47 var mime_type = "application/x-nacl"; | |
48 if (is_pnacl) { | |
49 mime_type = "application/x-pnacl"; | |
50 } | |
51 | 47 |
52 // 'bad_magic' loads a manifest, then loads a nexe that tests as invalid. | 48 // 'bad_magic' loads a manifest, then loads a nexe that tests as invalid. |
53 badLoadTest( | 49 badLoadTest( |
54 tester, | 50 tester, |
55 'bad_magic', | 51 'bad_magic', |
56 'ppapi_bad_magic.nmf', | 52 'ppapi_bad_magic.nmf', |
57 mime_type, | |
58 'NaCl module load failed: Bad ELF header magic number'); | 53 'NaCl module load failed: Bad ELF header magic number'); |
59 | 54 |
60 // 'cross_origin' loads a manifest, then tries to load a cross-origin nexe. | 55 // 'cross_origin' loads a manifest, then tries to load a cross-origin nexe. |
61 badLoadTest( | 56 badLoadTest( |
62 tester, | 57 tester, |
63 'cross_origin', | 58 'cross_origin', |
64 'ppapi_bad_crossorigin.nmf', | 59 'ppapi_bad_crossorigin.nmf', |
65 mime_type, | |
66 couldNotAccessNexe(is_pnacl)); | 60 couldNotAccessNexe(is_pnacl)); |
67 | 61 |
68 // 'cross_manifest' tries to load a cross-origin manifest. | 62 // 'cross_manifest' tries to load a cross-origin manifest. |
69 badLoadTest( | 63 badLoadTest( |
70 tester, | 64 tester, |
71 'cross_manifest', | 65 'cross_manifest', |
72 'http://www.google.com/crossorigin.manifest', | 66 'http://www.google.com/crossorigin.manifest', |
73 mime_type, | |
74 'NaCl module load failed: access to manifest url was denied.'); | 67 'NaCl module load failed: access to manifest url was denied.'); |
75 | 68 |
76 // 'nonexistent_nexe' loads a manifest, then tries to load a nonexistent nexe. | 69 // 'nonexistent_nexe' loads a manifest, then tries to load a nonexistent nexe, |
| 70 // given both a nexe and a portable program to choose from. |
77 badLoadTest( | 71 badLoadTest( |
78 tester, | 72 tester, |
79 'nonexistent_nexe', | 73 'nonexistent_nexe', |
80 'ppapi_bad_doesnotexist.nmf', | 74 'ppapi_bad_doesnotexist.nmf', |
81 mime_type, | |
82 couldNotLoadNexe(is_pnacl)); | 75 couldNotLoadNexe(is_pnacl)); |
83 | 76 |
| 77 // 'nonexistent_nexe_only' loads a manifest, then tries to load a nonexistent |
| 78 // nexe, given only a nexe to choose from. |
| 79 badLoadTest( |
| 80 tester, |
| 81 'nonexistent_nexe_only', |
| 82 'ppapi_bad_doesnotexist_nexe_only.nmf', |
| 83 'NaCl module load failed: could not load nexe url.'); |
| 84 |
84 // 'nonexistent_manifest' tries to load a nonexistent manifest. | 85 // 'nonexistent_manifest' tries to load a nonexistent manifest. |
85 badLoadTest( | 86 badLoadTest( |
86 tester, | 87 tester, |
87 'nonexistent_manifest', | 88 'nonexistent_manifest', |
88 'doesnotexist.manifest', | 89 'doesnotexist.manifest', |
89 mime_type, | |
90 'NaCl module load failed: could not load manifest url.'); | 90 'NaCl module load failed: could not load manifest url.'); |
91 | 91 |
92 // 'bad_manifest' loads an invalid manifest. | 92 // 'bad_manifest' loads an invalid manifest. |
93 badLoadTest( | 93 badLoadTest( |
94 tester, | 94 tester, |
95 'bad_manifest', | 95 'bad_manifest', |
96 'ppapi_bad.html', | 96 'ppapi_bad.html', |
97 mime_type, | |
98 'NaCl module load failed: manifest JSON parsing failed: * Line 1, Column 1
\n Syntax error: value, object or array expected.\n'); | 97 'NaCl module load failed: manifest JSON parsing failed: * Line 1, Column 1
\n Syntax error: value, object or array expected.\n'); |
99 | 98 |
100 // 'bad_manifest_uses_nexes' loads a manifest with an obsolete 'nexes' section
. | 99 // 'bad_manifest_uses_nexes' loads a manifest with an obsolete 'nexes' section
. |
101 badLoadTest( | 100 badLoadTest( |
102 tester, | 101 tester, |
103 'bad_manifest_uses_nexes', | 102 'bad_manifest_uses_nexes', |
104 'ppapi_bad_manifest_uses_nexes.nmf', | 103 'ppapi_bad_manifest_uses_nexes.nmf', |
105 mime_type, | |
106 'NaCl module load failed: manifest: missing \'program\' section.'); | 104 'NaCl module load failed: manifest: missing \'program\' section.'); |
107 | 105 |
108 // 'bad_manifest_bad_files' loads a manifest with a bad 'files' section. | 106 // 'bad_manifest_bad_files' loads a manifest with a bad 'files' section. |
109 badLoadTest( | 107 badLoadTest( |
110 tester, | 108 tester, |
111 'bad_manifest_bad_files', | 109 'bad_manifest_bad_files', |
112 'ppapi_bad_manifest_bad_files.nmf', | 110 'ppapi_bad_manifest_bad_files.nmf', |
113 mime_type, | |
114 // Manifest loader expects either 'url' or 'pnacl-translate' key present. | 111 // Manifest loader expects either 'url' or 'pnacl-translate' key present. |
115 // If neither is found, it complains about the last one. | 112 // If neither is found, it complains about the last one. |
116 'NaCl module load failed: manifest: file.txt property \'unknown_arch\' doe
s not have required key: \'url\'.'); | 113 'NaCl module load failed: manifest: file.txt property \'unknown_arch\' doe
s not have required key: \'pnacl-translate\'.'); |
117 | 114 |
118 // 'bad_manifest_nexe_arch' loads a manifest with no program entry for the | 115 // 'bad_manifest_nexe_arch' loads a manifest with no program entry for the |
119 // user's architecture | 116 // user's architecture |
120 badLoadTest( | 117 badLoadTest( |
121 tester, | 118 tester, |
122 'bad_manifest_nexe_arch', | 119 'bad_manifest_nexe_arch', |
123 'ppapi_bad_manifest_nexe_arch.nmf', | 120 'ppapi_bad_manifest_nexe_arch.nmf', |
124 mime_type, | |
125 'NaCl module load failed: manifest: no version of program given for curren
t arch and no portable version found.'); | 121 'NaCl module load failed: manifest: no version of program given for curren
t arch and no portable version found.'); |
126 | 122 |
127 ////////////////////////////////////// | 123 ////////////////////////////////////// |
128 // Initialization errors begin here // | 124 // Initialization errors begin here // |
129 ////////////////////////////////////// | 125 ////////////////////////////////////// |
130 | 126 |
131 // 'bad_ppp_initialize' loads a manifest, then loads a nexe that fails to | 127 // 'bad_ppp_initialize' loads a manifest, then loads a nexe that fails to |
132 // initialize PPAPI module | 128 // initialize PPAPI module |
133 badLoadTest( | 129 badLoadTest( |
134 tester, | 130 tester, |
135 'bad_ppp_initialize', | 131 'bad_ppp_initialize', |
136 'ppapi_bad_ppp_initialize.nmf', | 132 'ppapi_bad_ppp_initialize.nmf', |
137 mime_type, | |
138 'NaCl module load failed: could not initialize module.'); | 133 'NaCl module load failed: could not initialize module.'); |
139 | 134 |
140 // 'bad_ppp_initialize_crash' loads a manifest, then loads a nexe that crashes | 135 // 'bad_ppp_initialize_crash' loads a manifest, then loads a nexe that crashes |
141 // before initializing PPAPI module | 136 // before initializing PPAPI module |
142 badLoadTest( | 137 badLoadTest( |
143 tester, | 138 tester, |
144 'bad_ppp_initialize_crash', | 139 'bad_ppp_initialize_crash', |
145 'ppapi_bad_ppp_initialize_crash.nmf', | 140 'ppapi_bad_ppp_initialize_crash.nmf', |
146 mime_type, | |
147 'NaCl module load failed: could not initialize module.'); | 141 'NaCl module load failed: could not initialize module.'); |
148 | 142 |
149 // 'bad_no_ppp_instance' loads a manifest, then loads a nexe that fails to | 143 // 'bad_no_ppp_instance' loads a manifest, then loads a nexe that fails to |
150 // get the required PPP_Instance interface | 144 // get the required PPP_Instance interface |
151 badLoadTest( | 145 badLoadTest( |
152 tester, | 146 tester, |
153 'bad_no_ppp_instance', | 147 'bad_no_ppp_instance', |
154 'ppapi_bad_no_ppp_instance.nmf', | 148 'ppapi_bad_no_ppp_instance.nmf', |
155 mime_type, | |
156 'NaCl module load failed: could not initialize module.'); | 149 'NaCl module load failed: could not initialize module.'); |
157 | 150 |
158 // 'bad_get_ppp_instance_crash' loads a manifest, then loads a nexe that | 151 // 'bad_get_ppp_instance_crash' loads a manifest, then loads a nexe that |
159 // crashes when getting the required PPP_Instance interface | 152 // crashes when getting the required PPP_Instance interface |
160 badLoadTest( | 153 badLoadTest( |
161 tester, | 154 tester, |
162 'bad_get_ppp_instance_crash', | 155 'bad_get_ppp_instance_crash', |
163 'ppapi_bad_get_ppp_instance_crash.nmf', | 156 'ppapi_bad_get_ppp_instance_crash.nmf', |
164 mime_type, | |
165 'NaCl module load failed: could not initialize module.'); | 157 'NaCl module load failed: could not initialize module.'); |
166 | 158 |
167 // 'bad_ppp_instance_didcreate' loads a manifest, then loads a nexe that fails | 159 // 'bad_ppp_instance_didcreate' loads a manifest, then loads a nexe that fails |
168 // to create the instance | 160 // to create the instance |
169 badLoadTest( | 161 badLoadTest( |
170 tester, | 162 tester, |
171 'bad_ppp_instance_didcreate', | 163 'bad_ppp_instance_didcreate', |
172 'ppapi_bad_ppp_instance_didcreate.nmf', | 164 'ppapi_bad_ppp_instance_didcreate.nmf', |
173 mime_type, | |
174 'NaCl module load failed: could not create instance.'); | 165 'NaCl module load failed: could not create instance.'); |
175 | 166 |
176 // 'bad_ppp_instance_didcreate_crash' loads a manifest, then loads a nexe that | 167 // 'bad_ppp_instance_didcreate_crash' loads a manifest, then loads a nexe that |
177 // crashes before creating the instance. | 168 // crashes before creating the instance. |
178 badLoadTest( | 169 badLoadTest( |
179 tester, | 170 tester, |
180 'bad_ppp_instance_didcreate_crash', | 171 'bad_ppp_instance_didcreate_crash', |
181 'ppapi_bad_ppp_instance_didcreate_crash.nmf', | 172 'ppapi_bad_ppp_instance_didcreate_crash.nmf', |
182 mime_type, | |
183 'NaCl module load failed: could not create instance.'); | 173 'NaCl module load failed: could not create instance.'); |
184 | 174 |
185 /* TODO(bbudge) Re-enable this test when the IPC proxy can report these errors. | 175 /* TODO(bbudge) Re-enable this test when the IPC proxy can report these errors. |
186 http://crbug.com/160076 | 176 http://crbug.com/160076 |
187 // 'bad_event_replay_crash' loads a manifest, then loads a nexe and replays | 177 // 'bad_event_replay_crash' loads a manifest, then loads a nexe and replays |
188 // the events that occured during loading causing the nexe to crash before | 178 // the events that occured during loading causing the nexe to crash before |
189 // proxy start-up was completed. | 179 // proxy start-up was completed. |
190 badLoadTest( | 180 badLoadTest( |
191 tester, | 181 tester, |
192 'bad_event_replay_crash', | 182 'bad_event_replay_crash', |
193 'ppapi_bad_event_replay_crash.nmf', | 183 'ppapi_bad_event_replay_crash.nmf', |
194 mime_type, | |
195 'NaCl module load failed: instance crashed after creation.'); | 184 'NaCl module load failed: instance crashed after creation.'); |
196 */ | 185 */ |
197 } | 186 } |
198 | 187 |
199 | 188 |
200 // The driver invoked when the body has finished loading. | 189 // The driver invoked when the body has finished loading. |
201 function runTests() { | 190 function runTests() { |
202 var tester = new Tester($('body')); | 191 var tester = new Tester($('body')); |
203 tester.loadErrorsAreOK(); | 192 tester.loadErrorsAreOK(); |
204 declareTests(tester); | 193 declareTests(tester); |
(...skipping 23 matching lines...) Expand all Loading... |
228 style="background-color:gray" | 217 style="background-color:gray" |
229 type="application/pdf" /> | 218 type="application/pdf" /> |
230 | 219 |
231 <script type="text/javascript"> | 220 <script type="text/javascript"> |
232 //<![CDATA[ | 221 //<![CDATA[ |
233 runTests(); | 222 runTests(); |
234 //]]> | 223 //]]> |
235 </script> | 224 </script> |
236 </body> | 225 </body> |
237 </html> | 226 </html> |
OLD | NEW |