Title: [167763] trunk/LayoutTests
Revision
167763
Author
[email protected]
Date
2014-04-24 09:36:56 -0700 (Thu, 24 Apr 2014)

Log Message

Test that we correctly process ArrayBufferView slices in WebCrypto
https://bugs.webkit.org/show_bug.cgi?id=132087

Reviewed by Brent Fulgham.

* crypto/subtle/array-buffer-view-offset-expected.txt: Added.
* crypto/subtle/array-buffer-view-offset.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (167762 => 167763)


--- trunk/LayoutTests/ChangeLog	2014-04-24 16:31:21 UTC (rev 167762)
+++ trunk/LayoutTests/ChangeLog	2014-04-24 16:36:56 UTC (rev 167763)
@@ -1,3 +1,13 @@
+2014-04-24  Alexey Proskuryakov  <[email protected]>
+
+        Test that we correctly process ArrayBufferView slices in WebCrypto
+        https://bugs.webkit.org/show_bug.cgi?id=132087
+
+        Reviewed by Brent Fulgham.
+
+        * crypto/subtle/array-buffer-view-offset-expected.txt: Added.
+        * crypto/subtle/array-buffer-view-offset.html: Added.
+
 2014-04-24  Tamas Gergely  <[email protected]>
 
         ASSERTION FAILED: !begin.isIndefinite() in WebCore::SVGSMILElement::resolveFirstInterval.

Added: trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt (0 => 167763)


--- trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt	2014-04-24 16:36:56 UTC (rev 167763)
@@ -0,0 +1,10 @@
+Test that an ArrayBufferView with offset is processed correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS bytesToHexString(new Uint8Array(digest)) is '2c7e7c384f7829694282b1e3a6216def8082d055'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html (0 => 167763)


--- trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html	                        (rev 0)
+++ trunk/LayoutTests/crypto/subtle/array-buffer-view-offset.html	2014-04-24 16:36:56 UTC (rev 167763)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script src=""
+</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>
+
+<script src=""
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to