Bug 164758

Summary: js-test-pre.js::shouldReject doesn't need _rejectCallback and _resolveCallback
Product: WebKit Reporter: Jiewen Tan <jiewen_tan>
Component: Tools / TestsAssignee: Jiewen Tan <jiewen_tan>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jiewen_tan, lforschler, webkit-bug-importer, youennf, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
youennf: review+
Patch for landing none

Jiewen Tan
Reported 2016-11-14 18:05:04 PST
js-test-pre.js::shouldReject doesn't need _rejectCallback and _resolveCallback.
Attachments
Patch (7.76 KB, patch)
2016-11-14 18:09 PST, Jiewen Tan
youennf: review+
Patch for landing (7.73 KB, patch)
2016-11-15 11:32 PST, Jiewen Tan
no flags
Jiewen Tan
Comment 1 2016-11-14 18:09:43 PST
youenn fablet
Comment 2 2016-11-15 11:15:48 PST
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).
Jiewen Tan
Comment 3 2016-11-15 11:28:03 PST
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.
Jiewen Tan
Comment 4 2016-11-15 11:32:53 PST
Created attachment 294858 [details] Patch for landing
WebKit Commit Bot
Comment 5 2016-11-15 14:50:39 PST
Comment on attachment 294858 [details] Patch for landing Clearing flags on attachment: 294858 Committed r208759: <http://trac.webkit.org/changeset/208759>
Radar WebKit Bug Importer
Comment 6 2018-05-24 16:43:17 PDT
Note You need to log in before you can comment on or make changes to this bug.