Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / crypto / subtle / aes-cbc / failures.html
blobe7341dc2670ecd082c7c25f062db87fb7a567cae
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script src="../resources/common.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
11 <script>
12 description("Tests bad algorithm inputs for AES-CBC");
14 jsTestIsAsync = true;
16 var keyData = hexStringToUint8Array("2b7e151628aed2a6abf7158809cf4f3c");
17 var data = asciiToUint8Array("hello");
18 var key = null;
20 Promise.resolve(null).then(function(result) {
21 var usages = ['encrypt', 'decrypt'];
22 var extractable = false;
23 var algorithm = {name: 'aes-cbc'};
25 debug('\nImporting AES-CBC key...');
26 return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usages);
27 }).then(function(result) {
28 key = result;
30 debug('\nencrypt() with iv that is null...');
31 return crypto.subtle.encrypt({name: 'AES-CBC', iv: null}, key, data);
32 }).then(failAndFinishJSTest, function(result) {
33 logError(result);
35 debug('\nencrypt() without iv...');
36 return crypto.subtle.decrypt({name: 'AES-CBC'}, key, data);
37 }).then(failAndFinishJSTest, function(result) {
38 logError(result);
40 debug('\nencrypt() with iv that is a number...');
41 return crypto.subtle.encrypt({name: 'AES-CBC', iv: 3}, key, data);
42 }).then(failAndFinishJSTest, function(result) {
43 logError(result);
45 debug('\nencrypt() with an iv containing 0 bytes...');
46 return crypto.subtle.encrypt({name: 'AES-CBC', iv: new Uint8Array(0)}, key, data);
47 }).then(failAndFinishJSTest, function(result) {
48 logError(result);
50 debug('\nencrypt() with an iv containing 17 bytes...');
51 return crypto.subtle.encrypt({name: 'AES-CBC', iv: new ArrayBuffer(17)}, key, data);
52 }).then(failAndFinishJSTest, function(result) {
53 logError(result);
54 }).then(finishJSTest, failAndFinishJSTest);
56 </script>
58 </body>
59 </html>