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

Unified Diff: LayoutTests/crypto/importKey-badParameters.html

Issue 222003006: [webcrypto] Don't throw any extra WebIDL exceptions from WebCrypto methods. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 8 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/importKey-badParameters.html
diff --git a/LayoutTests/crypto/importKey-badParameters.html b/LayoutTests/crypto/importKey-badParameters.html
index 04e8c9c260c2f2676e128b42cabaed16239d65dd..9ce7c4c3ecd35386d3ff3dbc7ab9b7c879838cf5 100644
--- a/LayoutTests/crypto/importKey-badParameters.html
+++ b/LayoutTests/crypto/importKey-badParameters.html
@@ -21,14 +21,25 @@ var extractable = true;
// FIXME: http://crbug.com/262383
//shouldThrow("crypto.subtle.importKey('raw', aesKeyBytes, aesCbc, extractable, undefined)");
-// Invalid data
-shouldThrow("crypto.subtle.importKey('raw', [], aesCbc, extractable, ['encrypt'])");
-shouldThrow("crypto.subtle.importKey('raw', null, aesCbc, extractable, ['encrypt'])");
+Promise.resolve(null).then(function() {
+ // Invalid data
+ return crypto.subtle.importKey('raw', [], aesCbc, extractable, ['encrypt']);
+}).then(failAndFinishJSTest, function(result) {
+ error = result;
+ shouldBeNull("error");
+
+ // Invalid data
+ return crypto.subtle.importKey('raw', null, aesCbc, extractable, ['encrypt']);
+}).then(failAndFinishJSTest, function(result) {
+ error = result;
+ shouldBeNull("error");
-// Invalid algorithm
-shouldThrow("crypto.subtle.importKey('raw', aesCbc, null, extractable, ['encrypt'])");
+ // Invalid algorithm
+ return crypto.subtle.importKey('raw', aesKeyBytes, null, extractable, ['encrypt']);
+}).then(failAndFinishJSTest, function(result) {
+ error = result;
+ shouldBeNull("error");
-Promise.resolve(null).then(function() {
// Invalid format.
return crypto.subtle.importKey('invalid format', aesKeyBytes, aesCbc, extractable, ['encrypt']);
}).then(failAndFinishJSTest, function(result) {
« no previous file with comments | « LayoutTests/crypto/exportKey-badParameters-expected.txt ('k') | LayoutTests/crypto/importKey-badParameters-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698