Index: LayoutTests/crypto/sign-verify.html |
diff --git a/LayoutTests/crypto/sign-verify.html b/LayoutTests/crypto/sign-verify.html |
index d99f77223f1381b5fe4e638e7f2928ef0e7330a9..d25153327fef8e610dfbd31ab996459681faf5c9 100644 |
--- a/LayoutTests/crypto/sign-verify.html |
+++ b/LayoutTests/crypto/sign-verify.html |
@@ -14,8 +14,10 @@ description("Tests cypto.subtle.sign and crypto.subtle.verify"); |
jsTestIsAsync = true; |
-// A list of Promises for every test to run. |
-var allTests = []; |
+var runTests; |
+var allTests = new Promise(function(resolve) { |
+ runTests = resolve; |
+}); |
// ------------------------------------------------- |
// Successful sign/verify for HMAC |
@@ -119,14 +121,18 @@ function runSuccessTestCase(testCase) |
} |
// Add all of the tests defined above. |
-for (var i = 0; i < kHmacTestVectors.length; ++i) { |
- allTests.push(runSuccessTestCase(kHmacTestVectors[i])); |
-} |
+kHmacTestVectors.forEach(function(data) { |
+ allTests = allTests.then(function() { |
+ return runSuccessTestCase(data); |
+ }); |
+}); |
hmac = {name: 'hmac'}; |
data = asciiToUint8Array("hello"); |
-allTests.push(importTestKeys().then(function(importedKeys) { |
+allTests = allTests.then(function() { |
eroman
2014/03/26 09:07:58
In fact I have a similar changelist pending which
|
+ return importTestKeys(); |
+}).then(function(importedKeys) { |
keys = importedKeys; |
// Pass invalid signature parameters to verify() |
@@ -140,13 +146,13 @@ allTests.push(importTestKeys().then(function(importedKeys) { |
// Operation doesn't support signing (also given an invalid key, but the |
// first failure takes priority) |
shouldRejectPromiseWithNull("crypto.subtle.sign({name: 'RSAES-PKCS1-v1_5'}, keys.hmacSha1, data)"); |
-})); |
+}); |
// ------------------------------------------------- |
// Wait until all the tests have been run. |
// ------------------------------------------------- |
- |
-Promise.all(allTests).then(finishJSTest, failAndFinishJSTest); |
+allTests = allTests.then(finishJSTest, failAndFinishJSTest); |
+runTests(); |
</script> |