-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test that CryptoKey.algorithm returns a cached object
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
- Loading branch information
1 parent
c0de417
commit 71bc66f
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
WebCryptoAPI/cryptokey_algorithm_returns_cached_object.https.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// META: title=WebCryptoAPI: CryptoKey.algorithm getter returns cached object | ||
|
||
// https://w3c.github.io/webcrypto/#dom-cryptokey-algorithm | ||
// https://github.com/servo/servo/issues/33908 | ||
|
||
promise_test(function() { | ||
return self.crypto.subtle.generateKey( | ||
{ | ||
name: "AES-CTR", | ||
length: 256, | ||
}, | ||
true, | ||
["encrypt"], | ||
).then( | ||
function(key) { | ||
let a = key.algorithm; | ||
let b = key.algorithm; | ||
assert_true(a === b); | ||
}, | ||
function(err) { | ||
assert_unreached("generateKey threw an unexpected error: " + err.toString()); | ||
} | ||
); | ||
}, "CryptoKey.algorithm getter returns cached object"); |