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

Unified Diff: LayoutTests/crypto/crypto-random-values-types.html

Issue 16820007: Expose crypto.getRandomValues() to workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 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/crypto-random-values-types.html
diff --git a/LayoutTests/crypto/crypto-random-values-types.html b/LayoutTests/crypto/crypto-random-values-types.html
deleted file mode 100644
index 8d891ab55b53c15d970af91a21b0975a8b3ed642..0000000000000000000000000000000000000000
--- a/LayoutTests/crypto/crypto-random-values-types.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../fast/js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script>
-description("Tests which types are valid for crypto.randomValues.");
-
-if (!window.ArrayBuffer)
- debug("This test requres ArrayBuffers to run!");
-
-shouldBe("'crypto' in window", "true");
-shouldBe("'getRandomValues' in window.crypto", "true");
-
-function checkIntegerTypes() {
- var integerTypes = [
- "Uint8Array", "Int8Array", "Uint8ClampedArray",
- "Uint16Array", "Int16Array",
- "Uint32Array", "Int32Array",
- ];
- integerTypes.forEach(function(arrayType) {
- shouldBeDefined("random = crypto.getRandomValues(new "+arrayType+"(3))");
- shouldBeType("random", arrayType);
-
- shouldBeDefined("view = new "+arrayType+"(3)");
- shouldBeDefined("random = crypto.getRandomValues(view)");
- shouldBe("random", "view");
- });
-}
-
-function checkNonIntegerTypes() {
- var floatTypes = [
- "Float32Array", "Float64Array",
- ];
- floatTypes.forEach(function(arrayType) {
- shouldThrow("crypto.getRandomValues(new "+arrayType+"(3))");
- });
-
- shouldBeDefined("buffer = new Uint8Array(32)");
- shouldBeDefined("buffer.buffer");
- shouldBeDefined("view = new DataView(buffer.buffer)");
- shouldThrow("crypto.getRandomValues(view)");
-}
-
-checkIntegerTypes();
-checkNonIntegerTypes();
-
-</script>
-<script src="../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
-
-

Powered by Google App Engine
This is Rietveld 408576698