Bug 220872

Summary: [WPT] [Payment Request] slight adjustment to payment-request/payment-request-constructor-thcrash.https.html
Product: WebKit Reporter: Devin Rousso <hi>
Component: Tools / TestsAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, clopez, ews-watchlist, hi, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://github.com/web-platform-tests/wpt/pull/27292
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Devin Rousso 2021-01-22 11:17:12 PST
I'm pretty sure the first test in payment-request/payment-request-constructor-thcrash.https.html is incorrect because duplicate items in `methodData` provided to `PaymentRequest` should throw a `RangeError` according to step 4.3.3 of <https://www.w3.org/TR/payment-request/#constructor>.

The spec does mention in <https://www.w3.org/TR/payment-request/#conformance>
> User agents _MAY_ impose implementation-specific limits on otherwise unconstrained inputs, e.g., to prevent denial of service attacks, to guard against running out of memory, or to work around platform-specific limitations. When an input exceeds implementation-specific limit, the user agent _MUST_ throw, or, in the context of a promise, reject with, a `TypeError` optionally informing the developer of how a particular input exceeded an implementation-specific limit.
but does not specify whether this should happen before or after the above.

In WebKit's case, there is no "implementation-specific limit", so WebKit shouldn't throw a `TypeError` regardless.
Comment 1 Devin Rousso 2021-01-22 11:19:00 PST
Created attachment 418158 [details]
Patch
Comment 2 EWS Watchlist 2021-01-22 11:20:19 PST
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 3 Devin Rousso 2021-01-22 11:22:51 PST
Created attachment 418161 [details]
Patch
Comment 4 Devin Rousso 2021-01-22 11:24:05 PST
Created attachment 418162 [details]
Patch
Comment 5 Devin Rousso 2021-01-22 11:24:37 PST
Created attachment 418163 [details]
Patch
Comment 6 Devin Rousso 2021-01-22 12:54:21 PST
Created attachment 418172 [details]
Patch
Comment 7 Devin Rousso 2021-01-22 12:56:20 PST
Created attachment 418173 [details]
Patch
Comment 8 Devin Rousso 2021-01-22 12:56:50 PST
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/27292
Comment 9 youenn fablet 2021-01-22 13:03:41 PST
Comment on attachment 418173 [details]
Patch

Let's r+ it again so that WPT bot gets it
Comment 10 EWS 2021-01-22 13:50:03 PST
Committed r271759: <https://trac.webkit.org/changeset/271759>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418173 [details].
Comment 11 Radar WebKit Bug Importer 2021-01-22 13:51:14 PST
<rdar://problem/73514233>