Skip to content

Commit

Permalink
Test that CryptoKey.algorithm returns a cached object
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
  • Loading branch information
simonwuelker authored and servo-wpt-sync committed Nov 4, 2024
1 parent c0de417 commit 71bc66f
Showing 1 changed file with 24 additions and 0 deletions.
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");

0 comments on commit 71bc66f

Please sign in to comment.