OLD | NEW |
(Empty) | |
| 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> |
| 10 |
| 11 <script> |
| 12 description("Test that an ArrayBufferView with offset is processed correctly."); |
| 13 |
| 14 jsTestIsAsync = true; |
| 15 |
| 16 Promise.resolve(null).then(function() { |
| 17 var originalData = new Uint8Array([0xf, 0xf, 0xf, 0, 1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 0xf, 0xf, 0xf]); |
| 18 var slicedData = new Uint8Array(originalData.buffer, 3, 11); |
| 19 return crypto.subtle.digest({name: 'sha-1'}, slicedData); |
| 20 }).then(function(result) { |
| 21 digest = result; |
| 22 // Expected result for [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]. |
| 23 shouldBe("bytesToHexString(new Uint8Array(digest))", "'2c7e7c384f7829694282b
1e3a6216def8082d055'"); |
| 24 finishJSTest(); |
| 25 }); |
| 26 </script> |
| 27 |
| 28 </body> |
| 29 </html> |
OLD | NEW |