Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: LayoutTests/crypto/array-buffer-view-offset.html

Issue 806913006: [WebCrypto] Move LayoutTests from crypto to crypto/subtle (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update path for deserialize legacy tests Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../resources/js-test.js"></script> 4 <script src="../resources/js-test.js"></script>
5 <script src="resources/common.js"></script> 5 <script src="subtle/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
11 <script> 11 <script>
12 description("Test that an ArrayBufferView with offset is processed correctly."); 12 description("Test that an ArrayBufferView with offset is processed correctly.");
13 13
14 jsTestIsAsync = true; 14 jsTestIsAsync = true;
15 15
16 Promise.resolve(null).then(function() { 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]); 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); 18 var slicedData = new Uint8Array(originalData.buffer, 3, 11);
19 return crypto.subtle.digest({name: 'sha-1'}, slicedData); 19 return crypto.subtle.digest({name: 'sha-1'}, slicedData);
20 }).then(function(result) { 20 }).then(function(result) {
21 digest = result; 21 digest = result;
22 // Expected result for [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]. 22 // Expected result for [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].
23 shouldBe("bytesToHexString(new Uint8Array(digest))", "'2c7e7c384f7829694282b 1e3a6216def8082d055'"); 23 shouldBe("bytesToHexString(new Uint8Array(digest))", "'2c7e7c384f7829694282b 1e3a6216def8082d055'");
24 finishJSTest(); 24 finishJSTest();
25 }); 25 });
26 </script> 26 </script>
27 27
28 </body> 28 </body>
29 </html> 29 </html>
OLDNEW
« no previous file with comments | « LayoutTests/crypto/algorithm-identifier-as-string-expected.txt ('k') | LayoutTests/crypto/clone-aesKey.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698