diff --git a/WebCryptoAPI/cryptokey_algorithm_returns_cached_object.https.any.js b/WebCryptoAPI/cryptokey_algorithm_returns_cached_object.https.any.js new file mode 100644 index 00000000000000..b2d73fbab78d64 --- /dev/null +++ b/WebCryptoAPI/cryptokey_algorithm_returns_cached_object.https.any.js @@ -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"); \ No newline at end of file