OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../fast/js/resources/js-test-pre.js"></script> |
5 <script src="resources/common.js"></script> | 5 <script src="resources/common.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <p id="description"></p> | 8 <p id="description"></p> |
9 <div id="console"></div> | 9 <div id="console"></div> |
10 | 10 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 shouldBe("key.algorithm.name", "'AES-CBC'") | 149 shouldBe("key.algorithm.name", "'AES-CBC'") |
150 shouldBe("key.usages.join(',')", "''") | 150 shouldBe("key.usages.join(',')", "''") |
151 | 151 |
152 startNextTest(); | 152 startNextTest(); |
153 }, failHandler); | 153 }, failHandler); |
154 }, | 154 }, |
155 | 155 |
156 function() | 156 function() |
157 { | 157 { |
158 keyFormat = "spki"; | 158 keyFormat = "spki"; |
159 data = asciiToArrayBuffer("reject"); | 159 data = asciiToArrayBuffer("error"); |
160 algorithm = aesCbc; | 160 algorithm = aesCbc; |
161 extractable = false; | 161 extractable = false; |
162 keyUsages = []; | 162 keyUsages = []; |
163 | 163 |
164 crypto.subtle.importKey(keyFormat, data, algorithm, extractable, keyUsag
es).then( | 164 crypto.subtle.importKey(keyFormat, data, algorithm, extractable, keyUsag
es).then( |
165 failHandler, | 165 failHandler, |
166 function(value) { | 166 function(value) { |
167 debug("rejected with " + value); | 167 debug("rejected with " + value); |
168 startNextTest(); | 168 startNextTest(); |
169 }); | 169 }); |
170 }, | 170 }, |
171 | 171 |
172 function() | 172 function() |
173 { | 173 { |
174 keyFormat = "spki"; | |
175 data = asciiToArrayBuffer("throw"); | |
176 algorithm = aesCbc; | |
177 extractable = false; | |
178 keyUsages = []; | |
179 | |
180 shouldThrow("crypto.subtle.importKey(keyFormat, data, algorithm, extract
able, keyUsages)"); | |
181 startNextTest(); | |
182 }, | |
183 | |
184 function() | |
185 { | |
186 keyFormat = "raw"; | 174 keyFormat = "raw"; |
187 data = asciiToArrayBuffer(""); | 175 data = asciiToArrayBuffer(""); |
188 algorithm = aesCbc; | 176 algorithm = aesCbc; |
189 extractable = true; | 177 extractable = true; |
190 | 178 |
191 // Note contains duplicates and invalid entries. | 179 // Note contains duplicates and invalid entries. |
192 keyUsages = []; | 180 keyUsages = []; |
193 | 181 |
194 // Invalid format. | 182 // Invalid format. |
195 shouldThrow("crypto.subtle.importKey('invalid format', data, algorithm,
extractable, keyUsages)"); | 183 shouldThrow("crypto.subtle.importKey('invalid format', data, algorithm,
extractable, keyUsages)"); |
(...skipping 22 matching lines...) Expand all Loading... |
218 | 206 |
219 ]; | 207 ]; |
220 | 208 |
221 // Begin! | 209 // Begin! |
222 startNextTest(); | 210 startNextTest(); |
223 </script> | 211 </script> |
224 | 212 |
225 <script src="../fast/js/resources/js-test-post.js"></script> | 213 <script src="../fast/js/resources/js-test-post.js"></script> |
226 </body> | 214 </body> |
227 </html> | 215 </html> |
OLD | NEW |