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 } | |
47 | 51 |
48 // 'bad_magic' loads a manifest, then loads a nexe that tests as invalid. | 52 // 'bad_magic' loads a manifest, then loads a nexe that tests as invalid. |
49 badLoadTest( | 53 badLoadTest( |
50 tester, | 54 tester, |
51 'bad_magic', | 55 'bad_magic', |
52 'ppapi_bad_magic.nmf', | 56 'ppapi_bad_magic.nmf', |
57 mime_type, | |
53 'NaCl module load failed: Bad ELF header magic number'); | 58 'NaCl module load failed: Bad ELF header magic number'); |
54 | 59 |
55 // 'cross_origin' loads a manifest, then tries to load a cross-origin nexe. | 60 // 'cross_origin' loads a manifest, then tries to load a cross-origin nexe. |
56 badLoadTest( | 61 badLoadTest( |
57 tester, | 62 tester, |
58 'cross_origin', | 63 'cross_origin', |
59 'ppapi_bad_crossorigin.nmf', | 64 'ppapi_bad_crossorigin.nmf', |
65 mime_type, | |
60 couldNotAccessNexe(is_pnacl)); | 66 couldNotAccessNexe(is_pnacl)); |
61 | 67 |
62 // 'cross_manifest' tries to load a cross-origin manifest. | 68 // 'cross_manifest' tries to load a cross-origin manifest. |
63 badLoadTest( | 69 badLoadTest( |
64 tester, | 70 tester, |
65 'cross_manifest', | 71 'cross_manifest', |
66 'http://www.google.com/crossorigin.manifest', | 72 'http://www.google.com/crossorigin.manifest', |
73 mime_type, | |
67 'NaCl module load failed: access to manifest url was denied.'); | 74 'NaCl module load failed: access to manifest url was denied.'); |
68 | 75 |
69 // 'nonexistent_nexe' loads a manifest, then tries to load a nonexistent nexe, | 76 // '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 // given both a nexe and a portable program to choose from. |
jvoung (off chromium)
2013/06/06 22:41:25
Can update comment for this test, since we took ou
sehr
2013/06/07 23:34:47
I retained the first, since the nexe_only part is
| |
71 badLoadTest( | 78 badLoadTest( |
72 tester, | 79 tester, |
73 'nonexistent_nexe', | 80 'nonexistent_nexe', |
74 'ppapi_bad_doesnotexist.nmf', | 81 'ppapi_bad_doesnotexist.nmf', |
82 mime_type, | |
75 couldNotLoadNexe(is_pnacl)); | 83 couldNotLoadNexe(is_pnacl)); |
76 | 84 |
77 // 'nonexistent_nexe_only' loads a manifest, then tries to load a nonexistent | 85 // 'nonexistent_nexe_only' loads a manifest, then tries to load a nonexistent |
78 // nexe, given only a nexe to choose from. | 86 // nexe, given only a nexe to choose from. |
79 badLoadTest( | 87 badLoadTest( |
80 tester, | 88 tester, |
81 'nonexistent_nexe_only', | 89 'nonexistent_nexe_only', |
82 'ppapi_bad_doesnotexist_nexe_only.nmf', | 90 'ppapi_bad_doesnotexist_nexe_only.nmf', |
91 mime_type, | |
83 'NaCl module load failed: could not load nexe url.'); | 92 'NaCl module load failed: could not load nexe url.'); |
84 | 93 |
85 // 'nonexistent_manifest' tries to load a nonexistent manifest. | 94 // 'nonexistent_manifest' tries to load a nonexistent manifest. |
86 badLoadTest( | 95 badLoadTest( |
87 tester, | 96 tester, |
88 'nonexistent_manifest', | 97 'nonexistent_manifest', |
89 'doesnotexist.manifest', | 98 'doesnotexist.manifest', |
99 mime_type, | |
90 'NaCl module load failed: could not load manifest url.'); | 100 'NaCl module load failed: could not load manifest url.'); |
91 | 101 |
92 // 'bad_manifest' loads an invalid manifest. | 102 // 'bad_manifest' loads an invalid manifest. |
93 badLoadTest( | 103 badLoadTest( |
94 tester, | 104 tester, |
95 'bad_manifest', | 105 'bad_manifest', |
96 'ppapi_bad.html', | 106 'ppapi_bad.html', |
107 mime_type, | |
97 'NaCl module load failed: manifest JSON parsing failed: * Line 1, Column 1 \n Syntax error: value, object or array expected.\n'); | 108 'NaCl module load failed: manifest JSON parsing failed: * Line 1, Column 1 \n Syntax error: value, object or array expected.\n'); |
98 | 109 |
99 // 'bad_manifest_uses_nexes' loads a manifest with an obsolete 'nexes' section . | 110 // 'bad_manifest_uses_nexes' loads a manifest with an obsolete 'nexes' section . |
100 badLoadTest( | 111 badLoadTest( |
101 tester, | 112 tester, |
102 'bad_manifest_uses_nexes', | 113 'bad_manifest_uses_nexes', |
103 'ppapi_bad_manifest_uses_nexes.nmf', | 114 'ppapi_bad_manifest_uses_nexes.nmf', |
115 mime_type, | |
104 'NaCl module load failed: manifest: missing \'program\' section.'); | 116 'NaCl module load failed: manifest: missing \'program\' section.'); |
105 | 117 |
106 // 'bad_manifest_bad_files' loads a manifest with a bad 'files' section. | 118 // 'bad_manifest_bad_files' loads a manifest with a bad 'files' section. |
107 badLoadTest( | 119 badLoadTest( |
108 tester, | 120 tester, |
109 'bad_manifest_bad_files', | 121 'bad_manifest_bad_files', |
110 'ppapi_bad_manifest_bad_files.nmf', | 122 'ppapi_bad_manifest_bad_files.nmf', |
123 mime_type, | |
111 // Manifest loader expects either 'url' or 'pnacl-translate' key present. | 124 // Manifest loader expects either 'url' or 'pnacl-translate' key present. |
112 // If neither is found, it complains about the last one. | 125 // If neither is found, it complains about the last one. |
113 'NaCl module load failed: manifest: file.txt property \'unknown_arch\' doe s not have required key: \'pnacl-translate\'.'); | 126 'NaCl module load failed: manifest: file.txt property \'unknown_arch\' doe s not have required key: \'url\'.'); |
114 | 127 |
115 // 'bad_manifest_nexe_arch' loads a manifest with no program entry for the | 128 // 'bad_manifest_nexe_arch' loads a manifest with no program entry for the |
116 // user's architecture | 129 // user's architecture |
117 badLoadTest( | 130 badLoadTest( |
118 tester, | 131 tester, |
119 'bad_manifest_nexe_arch', | 132 'bad_manifest_nexe_arch', |
120 'ppapi_bad_manifest_nexe_arch.nmf', | 133 'ppapi_bad_manifest_nexe_arch.nmf', |
134 mime_type, | |
121 'NaCl module load failed: manifest: no version of program given for curren t arch and no portable version found.'); | 135 'NaCl module load failed: manifest: no version of program given for curren t arch and no portable version found.'); |
122 | 136 |
123 ////////////////////////////////////// | 137 ////////////////////////////////////// |
124 // Initialization errors begin here // | 138 // Initialization errors begin here // |
125 ////////////////////////////////////// | 139 ////////////////////////////////////// |
126 | 140 |
127 // 'bad_ppp_initialize' loads a manifest, then loads a nexe that fails to | 141 // 'bad_ppp_initialize' loads a manifest, then loads a nexe that fails to |
128 // initialize PPAPI module | 142 // initialize PPAPI module |
129 badLoadTest( | 143 badLoadTest( |
130 tester, | 144 tester, |
131 'bad_ppp_initialize', | 145 'bad_ppp_initialize', |
132 'ppapi_bad_ppp_initialize.nmf', | 146 'ppapi_bad_ppp_initialize.nmf', |
147 mime_type, | |
133 'NaCl module load failed: could not initialize module.'); | 148 'NaCl module load failed: could not initialize module.'); |
134 | 149 |
135 // 'bad_ppp_initialize_crash' loads a manifest, then loads a nexe that crashes | 150 // 'bad_ppp_initialize_crash' loads a manifest, then loads a nexe that crashes |
136 // before initializing PPAPI module | 151 // before initializing PPAPI module |
137 badLoadTest( | 152 badLoadTest( |
138 tester, | 153 tester, |
139 'bad_ppp_initialize_crash', | 154 'bad_ppp_initialize_crash', |
140 'ppapi_bad_ppp_initialize_crash.nmf', | 155 'ppapi_bad_ppp_initialize_crash.nmf', |
156 mime_type, | |
141 'NaCl module load failed: could not initialize module.'); | 157 'NaCl module load failed: could not initialize module.'); |
142 | 158 |
143 // 'bad_no_ppp_instance' loads a manifest, then loads a nexe that fails to | 159 // 'bad_no_ppp_instance' loads a manifest, then loads a nexe that fails to |
144 // get the required PPP_Instance interface | 160 // get the required PPP_Instance interface |
145 badLoadTest( | 161 badLoadTest( |
146 tester, | 162 tester, |
147 'bad_no_ppp_instance', | 163 'bad_no_ppp_instance', |
148 'ppapi_bad_no_ppp_instance.nmf', | 164 'ppapi_bad_no_ppp_instance.nmf', |
165 mime_type, | |
149 'NaCl module load failed: could not initialize module.'); | 166 'NaCl module load failed: could not initialize module.'); |
150 | 167 |
151 // 'bad_get_ppp_instance_crash' loads a manifest, then loads a nexe that | 168 // 'bad_get_ppp_instance_crash' loads a manifest, then loads a nexe that |
152 // crashes when getting the required PPP_Instance interface | 169 // crashes when getting the required PPP_Instance interface |
153 badLoadTest( | 170 badLoadTest( |
154 tester, | 171 tester, |
155 'bad_get_ppp_instance_crash', | 172 'bad_get_ppp_instance_crash', |
156 'ppapi_bad_get_ppp_instance_crash.nmf', | 173 'ppapi_bad_get_ppp_instance_crash.nmf', |
174 mime_type, | |
157 'NaCl module load failed: could not initialize module.'); | 175 'NaCl module load failed: could not initialize module.'); |
158 | 176 |
159 // 'bad_ppp_instance_didcreate' loads a manifest, then loads a nexe that fails | 177 // 'bad_ppp_instance_didcreate' loads a manifest, then loads a nexe that fails |
160 // to create the instance | 178 // to create the instance |
161 badLoadTest( | 179 badLoadTest( |
162 tester, | 180 tester, |
163 'bad_ppp_instance_didcreate', | 181 'bad_ppp_instance_didcreate', |
164 'ppapi_bad_ppp_instance_didcreate.nmf', | 182 'ppapi_bad_ppp_instance_didcreate.nmf', |
183 mime_type, | |
165 'NaCl module load failed: could not create instance.'); | 184 'NaCl module load failed: could not create instance.'); |
166 | 185 |
167 // 'bad_ppp_instance_didcreate_crash' loads a manifest, then loads a nexe that | 186 // 'bad_ppp_instance_didcreate_crash' loads a manifest, then loads a nexe that |
168 // crashes before creating the instance. | 187 // crashes before creating the instance. |
169 badLoadTest( | 188 badLoadTest( |
170 tester, | 189 tester, |
171 'bad_ppp_instance_didcreate_crash', | 190 'bad_ppp_instance_didcreate_crash', |
172 'ppapi_bad_ppp_instance_didcreate_crash.nmf', | 191 'ppapi_bad_ppp_instance_didcreate_crash.nmf', |
192 mime_type, | |
173 'NaCl module load failed: could not create instance.'); | 193 'NaCl module load failed: could not create instance.'); |
174 | 194 |
175 /* TODO(bbudge) Re-enable this test when the IPC proxy can report these errors. | 195 /* TODO(bbudge) Re-enable this test when the IPC proxy can report these errors. |
176 http://crbug.com/160076 | 196 http://crbug.com/160076 |
177 // 'bad_event_replay_crash' loads a manifest, then loads a nexe and replays | 197 // 'bad_event_replay_crash' loads a manifest, then loads a nexe and replays |
178 // the events that occured during loading causing the nexe to crash before | 198 // the events that occured during loading causing the nexe to crash before |
179 // proxy start-up was completed. | 199 // proxy start-up was completed. |
180 badLoadTest( | 200 badLoadTest( |
181 tester, | 201 tester, |
182 'bad_event_replay_crash', | 202 'bad_event_replay_crash', |
183 'ppapi_bad_event_replay_crash.nmf', | 203 'ppapi_bad_event_replay_crash.nmf', |
204 mime_type, | |
184 'NaCl module load failed: instance crashed after creation.'); | 205 'NaCl module load failed: instance crashed after creation.'); |
185 */ | 206 */ |
186 } | 207 } |
187 | 208 |
188 | 209 |
189 // The driver invoked when the body has finished loading. | 210 // The driver invoked when the body has finished loading. |
190 function runTests() { | 211 function runTests() { |
191 var tester = new Tester($('body')); | 212 var tester = new Tester($('body')); |
192 tester.loadErrorsAreOK(); | 213 tester.loadErrorsAreOK(); |
193 declareTests(tester); | 214 declareTests(tester); |
(...skipping 23 matching lines...) Expand all Loading... | |
217 style="background-color:gray" | 238 style="background-color:gray" |
218 type="application/pdf" /> | 239 type="application/pdf" /> |
219 | 240 |
220 <script type="text/javascript"> | 241 <script type="text/javascript"> |
221 //<![CDATA[ | 242 //<![CDATA[ |
222 runTests(); | 243 runTests(); |
223 //]]> | 244 //]]> |
224 </script> | 245 </script> |
225 </body> | 246 </body> |
226 </html> | 247 </html> |
OLD | NEW |