From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../tests/WebCryptoAPI/tools/generate.py | 76 ++++++++++++++++++++++ 1 file changed, 76 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 000000000..0d3696128 --- /dev/null +++ b/testing/web-platform/tests/WebCryptoAPI/tools/generate.py @@ -0,0 +1,76 @@ +# 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 = """// timeout=long +importScripts("/resources/testharness.js"); +importScripts("../util/helpers.js"); +importScripts("successes.js"); + +run_test([%s]); +done();""" + +failures_worker = """// 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"] + +for filename_pattern, template in [("test_successes_%s.html", successes_html), + ("test_failures_%s.html", failures_html), + ("successes_%s.worker.js", successes_worker), + ("failures_%s.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