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

Unified Diff: LayoutTests/crypto/resources/random-values.js

Issue 806913006: [WebCrypto] Move LayoutTests from crypto to crypto/subtle (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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/resources/random-values.js
diff --git a/LayoutTests/crypto/resources/random-values.js b/LayoutTests/crypto/resources/random-values.js
deleted file mode 100644
index 421ee1d3803f26899d9e8cb00eea9bc0b8bcf198..0000000000000000000000000000000000000000
--- a/LayoutTests/crypto/resources/random-values.js
+++ /dev/null
@@ -1,40 +0,0 @@
-if (self.importScripts)
- importScripts('../../resources/js-test.js');
-
-description("Tests crypto.randomValues.");
-
-if (!self.ArrayBuffer)
- debug("This test requres ArrayBuffers to run!");
-
-shouldBe("'crypto' in self", "true");
-shouldBe("'getRandomValues' in self.crypto", "true");
-
-// Although the spec defines Crypto in terms of "RandomSource", it is NOT
-// inheritance. The RandomSource interface should not be visible to
-// javascript.
-shouldBe("self.crypto.__proto__.hasOwnProperty('getRandomValues')", "true");
-
-try {
- // NOTE: This test is flaky. If we ran this test every second since the
- // beginning of the universe, on average, it would have failed
- // 2^{-748} times.
-
- var reference = new Uint8Array(100);
- var sample = new Uint8Array(100);
-
- crypto.getRandomValues(reference);
- crypto.getRandomValues(sample);
-
- var matchingBytes = 0;
-
- for (var i = 0; i < reference.length; i++) {
- if (reference[i] == sample[i])
- matchingBytes++;
- }
-
- shouldBe("matchingBytes < 100", "true");
-} catch(ex) {
- debug(ex);
-}
-
-finishJSTest();

Powered by Google App Engine
This is Rietveld 408576698