From 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:47:29 +0200 Subject: Adding upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- .../tests/WebCryptoAPI/tools/generate.py | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 testing/web-platform/tests/WebCryptoAPI/tools/generate.py (limited to 'testing/web-platform/tests/WebCryptoAPI/tools') diff --git a/testing/web-platform/tests/WebCryptoAPI/tools/generate.py b/testing/web-platform/tests/WebCryptoAPI/tools/generate.py new file mode 100644 index 0000000000..35ba0f0031 --- /dev/null +++ b/testing/web-platform/tests/WebCryptoAPI/tools/generate.py @@ -0,0 +1,77 @@ +# script to generate the generateKey tests + +import os + +here = os.path.dirname(__file__) + +successes_html = """ + + +WebCryptoAPI: generateKey() Successful Calls + + + + + + + + +

generateKey Tests for Good Parameters

+

+ Warning! RSA key generation is intrinsically + very slow, so the related tests can take up to + several minutes to complete, depending on browser! +

+ +
+""" + +failures_html = """ + + +WebCryptoAPI: generateKey() for Failures + + + + + + + + +

generateKey Tests for Bad Parameters

+ +
+ +""" + +successes_worker = """// META: timeout=long +importScripts("/resources/testharness.js"); +importScripts("../util/helpers.js"); +importScripts("successes.js"); + +run_test([%s]); +done();""" + +failures_worker = """// META: timeout=long +importScripts("/resources/testharness.js"); +importScripts("../util/helpers.js"); +importScripts("failures.js"); +run_test([%s]); +done();""" + +names = ["AES-CTR", "AES-CBC", "AES-GCM", "AES-KW", "HMAC", "RSASSA-PKCS1-v1_5", + "RSA-PSS", "RSA-OAEP", "ECDSA", "ECDH", "Ed25519", "Ed448", "X25519", + "X448"] + +for filename_pattern, template in [("test_successes_%s.https.html", successes_html), + ("test_failures_%s.https.html", failures_html), + ("successes_%s.https.worker.js", successes_worker), + ("failures_%s.https.worker.js", failures_worker)]: + for name in names: + path = os.path.join(here, os.pardir, "generateKey", filename_pattern % name) + with open(path, "w") as f: + f.write(template % '"%s"' % name) -- cgit v1.2.3