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

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

Issue 298023002: [webcrypto] Import WebKit's webcrypto tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove FIXME for unrecognized jwk usages (supported now) Created 6 years, 6 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
Index: LayoutTests/crypto/array-buffer-view-offset.html
diff --git a/LayoutTests/crypto/array-buffer-view-offset.html b/LayoutTests/crypto/array-buffer-view-offset.html
new file mode 100644
index 0000000000000000000000000000000000000000..221aed1a97aafc6846eca079bfdcc0d10474306c
--- /dev/null
+++ b/LayoutTests/crypto/array-buffer-view-offset.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../resources/js-test.js"></script>
+<script src="resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test that an ArrayBufferView with offset is processed correctly.");
+
+jsTestIsAsync = true;
+
+Promise.resolve(null).then(function() {
+ var originalData = new Uint8Array([0xf, 0xf, 0xf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0xf, 0xf, 0xf]);
+ var slicedData = new Uint8Array(originalData.buffer, 3, 11);
+ return crypto.subtle.digest({name: 'sha-1'}, slicedData);
+}).then(function(result) {
+ digest = result;
+ // Expected result for [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].
+ shouldBe("bytesToHexString(new Uint8Array(digest))", "'2c7e7c384f7829694282b1e3a6216def8082d055'");
+ finishJSTest();
+});
+</script>
+
+</body>
+</html>
« no previous file with comments | « LayoutTests/crypto/aes-kw-wrap-unwrap-aes-expected.txt ('k') | LayoutTests/crypto/array-buffer-view-offset-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698