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

Side by Side Diff: LayoutTests/crypto/resources/random-values-types.js

Issue 801283002: [bindings] Make Crypto.getRandomValues use generated binding rather than using custom binding. (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 unified diff | Download patch
OLDNEW
1 if (self.importScripts) 1 if (self.importScripts)
2 importScripts('../../resources/js-test.js'); 2 importScripts('../../resources/js-test.js');
3 3
4 description("Tests which types are valid for crypto.randomValues."); 4 description("Tests which types are valid for crypto.randomValues.");
5 5
6 if (!self.ArrayBuffer) 6 if (!self.ArrayBuffer)
7 debug("This test requres ArrayBuffers to run!"); 7 debug("This test requres ArrayBuffers to run!");
8 8
9 shouldBe("'crypto' in self", "true"); 9 shouldBe("'crypto' in self", "true");
10 shouldBe("'getRandomValues' in self.crypto", "true"); 10 shouldBe("'getRandomValues' in self.crypto", "true");
(...skipping 21 matching lines...) Expand all
32 floatTypes.forEach(function(arrayType) { 32 floatTypes.forEach(function(arrayType) {
33 shouldThrow("crypto.getRandomValues(new "+arrayType+"(3))"); 33 shouldThrow("crypto.getRandomValues(new "+arrayType+"(3))");
34 }); 34 });
35 35
36 shouldBeDefined("buffer = new Uint8Array(32)"); 36 shouldBeDefined("buffer = new Uint8Array(32)");
37 shouldBeDefined("buffer.buffer"); 37 shouldBeDefined("buffer.buffer");
38 shouldBeDefined("view = new DataView(buffer.buffer)"); 38 shouldBeDefined("view = new DataView(buffer.buffer)");
39 shouldThrow("crypto.getRandomValues(view)"); 39 shouldThrow("crypto.getRandomValues(view)");
40 } 40 }
41 41
42 shouldThrow("crypto.getRandomValues()");
43 shouldThrow("crypto.getRandomValues(undefined)");
44 shouldThrow("crypto.getRandomValues(null)");
42 checkIntegerTypes(); 45 checkIntegerTypes();
43 checkNonIntegerTypes(); 46 checkNonIntegerTypes();
44 47
45 finishJSTest(); 48 finishJSTest();
OLDNEW
« no previous file with comments | « LayoutTests/crypto/random-values-types-expected.txt ('k') | LayoutTests/crypto/worker-random-values-types-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698