js-test-pre.js::shouldReject doesn't need _rejectCallback and _resolveCallback.
Created attachment 294789 [details] Patch
Comment on attachment 294789 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=294789&action=review > LayoutTests/crypto/subtle/generate-key-malformed-parameters.html:62 > +shouldReject('crypto.subtle.generateKey({name: "RSAES-PKCS1-v1_5", modulusLength: 2048, publicExponent: new Uint8Array([0x01, 0x00, 0x01])}, extractable, [ ])').then(finishJSTest, finishJSTest); then(finishJSTest) should be sufficient. > LayoutTests/crypto/subtle/rsa-generate-key-malformed-parameters.html:53 > +shouldReject('crypto.subtle.generateKey({name: "RSASSA-PKCS1-v1_5", modulusLength: 0, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["sign", "verify"])').then(finishJSTest, finishJSTest); Ditto. > LayoutTests/crypto/workers/subtle/resources/rsa-generate-key.js:14 > +}).then(function(result) { Here shouldReject calls are chained. In the other tests, they are not. Is this by design? Not chaining make the shouldReject run in parallel. This allows checking that rejection is done synchronous (although callback is called asynchronously).
Comment on attachment 294789 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=294789&action=review First of all, thanks Youenn for reviewing my patch. >> LayoutTests/crypto/subtle/generate-key-malformed-parameters.html:62 >> +shouldReject('crypto.subtle.generateKey({name: "RSAES-PKCS1-v1_5", modulusLength: 2048, publicExponent: new Uint8Array([0x01, 0x00, 0x01])}, extractable, [ ])').then(finishJSTest, finishJSTest); > > then(finishJSTest) should be sufficient. Fixed. >> LayoutTests/crypto/subtle/rsa-generate-key-malformed-parameters.html:53 >> +shouldReject('crypto.subtle.generateKey({name: "RSASSA-PKCS1-v1_5", modulusLength: 0, publicExponent: publicExponent, hash: "sha-1"}, extractable, ["sign", "verify"])').then(finishJSTest, finishJSTest); > > Ditto. Fixed. >> LayoutTests/crypto/workers/subtle/resources/rsa-generate-key.js:14 >> +}).then(function(result) { > > Here shouldReject calls are chained. > In the other tests, they are not. Is this by design? > > Not chaining make the shouldReject run in parallel. > This allows checking that rejection is done synchronous (although callback is called asynchronously). Yes, this is done by design. The first one is reject before the main thread hands over the key generation job to a secondary thread. Therefore, it should be reject synchronously. While the second one is reject after, and therefore it should be reject asynchronously.
Created attachment 294858 [details] Patch for landing
Comment on attachment 294858 [details] Patch for landing Clearing flags on attachment: 294858 Committed r208759: <http://trac.webkit.org/changeset/208759>
<rdar://problem/40539450>