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

Unified Diff: LayoutTests/crypto/exportKey-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/exportKey-badParameters.html
diff --git a/LayoutTests/crypto/exportKey-badParameters.html b/LayoutTests/crypto/exportKey-badParameters.html
index 638d8b47b5768c74ed29cbbcb8805ff839957756..61244af2f04e1d586ba1e93a3c36deef573dba24 100644
--- a/LayoutTests/crypto/exportKey-badParameters.html
+++ b/LayoutTests/crypto/exportKey-badParameters.html
@@ -13,10 +13,6 @@ description("Tests exportKey() given bad inputs.");
jsTestIsAsync = true;
-// Not keys
-shouldThrow("crypto.subtle.exportKey('raw', null)");
-shouldThrow("crypto.subtle.exportKey('raw', 3)");
-
function importAesKey()
{
var keyData = new Uint8Array(16);
@@ -27,7 +23,21 @@ function importAesKey()
return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usages);
}
-importAesKey().then(function(result) {
+Promise.resolve(null).then(function(result) {
+ // null is not a valid Key.
+ return crypto.subtle.exportKey('raw', null);
+}).then(failAndFinishJSTest, function(result) {
+ error = result;
+ shouldBeNull("error");
+
+ // 3 is not a valid Key.
+ return crypto.subtle.exportKey('raw', 3);
+}).then(failAndFinishJSTest, function(result) {
+ error = result;
+ shouldBeNull("error");
+
+ return importAesKey();
+}).then(function(result) {
key = result;
// Invalid export format
« no previous file with comments | « LayoutTests/crypto/digest-failures-expected.txt ('k') | LayoutTests/crypto/exportKey-badParameters-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698