diff options
Diffstat (limited to 'testing/web-platform/tests/WebCryptoAPI/getRandomValues.any.js')
-rw-r--r-- | testing/web-platform/tests/WebCryptoAPI/getRandomValues.any.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/testing/web-platform/tests/WebCryptoAPI/getRandomValues.any.js b/testing/web-platform/tests/WebCryptoAPI/getRandomValues.any.js index 1a3370ea13..2b82b9bedb 100644 --- a/testing/web-platform/tests/WebCryptoAPI/getRandomValues.any.js +++ b/testing/web-platform/tests/WebCryptoAPI/getRandomValues.any.js @@ -1,6 +1,9 @@ // Step 1. test(function() { assert_throws_dom("TypeMismatchError", function() { + self.crypto.getRandomValues(new Float16Array(6)) + }, "Float16Array") + assert_throws_dom("TypeMismatchError", function() { self.crypto.getRandomValues(new Float32Array(6)) }, "Float32Array") assert_throws_dom("TypeMismatchError", function() { @@ -8,6 +11,10 @@ test(function() { }, "Float64Array") assert_throws_dom("TypeMismatchError", function() { + const len = 65536 / Float16Array.BYTES_PER_ELEMENT + 1; + self.crypto.getRandomValues(new Float16Array(len)); + }, "Float16Array (too long)") + assert_throws_dom("TypeMismatchError", function() { const len = 65536 / Float32Array.BYTES_PER_ELEMENT + 1; self.crypto.getRandomValues(new Float32Array(len)); }, "Float32Array (too long)") |