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

Unified Diff: LayoutTests/crypto/sign-verify.html

Issue 39093002: [webcrypto] Add some more layouttests for crypto.subtle.digest() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/crypto/resources/common.js ('k') | LayoutTests/crypto/sign-verify-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/sign-verify.html
diff --git a/LayoutTests/crypto/sign-verify.html b/LayoutTests/crypto/sign-verify.html
index 2c1294d98c2023fb9d476c80124691ca0d2e7099..6ab4da8c1b02d22ec2978db4e489ce714ea77ca0 100644
--- a/LayoutTests/crypto/sign-verify.html
+++ b/LayoutTests/crypto/sign-verify.html
@@ -14,7 +14,7 @@ description("Tests cypto.subtle.sign and crypto.subtle.verify");
jsTestIsAsync = true;
hmacSha1 = {name: 'hmac', hash: {name: 'sha-1'}};
-data = asciiToArrayBuffer("hello");
+data = asciiToUint8Array("hello");
importTestKeys().then(function(importedKeys) {
keys = importedKeys;
@@ -46,15 +46,14 @@ importTestKeys().then(function(importedKeys) {
return crypto.subtle.sign(hmacSha1, keys.hmacSha1, data);
}).then(function(result) {
- signResult = arrayBufferToHexString(result);
- shouldBe("signResult", "'[89 0d 9b 89 4b 23 97 69 ac 77 25 04 66 dc e4 2a f9 26 ed 76]'");
+ bytesShouldMatchHexString('HMAC SHA1 signature', "890d9b894b239769ac77250466dce42af926ed76", result);
return crypto.subtle.verify(hmacSha1, keys.hmacSha1, new Uint8Array(result), data);
}).then(function(result) {
verifyResult = result;
shouldBe("verifyResult", "true");
- return crypto.subtle.verify(hmacSha1, keys.hmacSha1, asciiToArrayBuffer("badsignature"), data);
+ return crypto.subtle.verify(hmacSha1, keys.hmacSha1, asciiToUint8Array("badsignature"), data);
}).then(function(result) {
verifyResult = result;
shouldBe("verifyResult", "false");
« no previous file with comments | « LayoutTests/crypto/resources/common.js ('k') | LayoutTests/crypto/sign-verify-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698