4 <script src=
"../resources/js-test.js"></script>
5 <script src=
"subtle/resources/common.js"></script>
8 <p id=
"description"></p>
9 <div id=
"console"></div>
12 description("Test that an ArrayBufferView with offset is processed correctly.");
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
) {
22 // Expected result for [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].
23 shouldBe("bytesToHexString(new Uint8Array(digest))", "'2c7e7c384f7829694282b1e3a6216def8082d055'");