mirror of
https://github.com/servo/servo.git
synced 2025-09-03 11:38:22 +01:00
Update web-platform-tests to revision 2d68590d46a990bf28a08d6384a59962d2e56bf6
This commit is contained in:
parent
bc03d32142
commit
ad4cc3691e
135 changed files with 1613 additions and 341 deletions
|
@ -72,6 +72,7 @@ function runManualTest(button, expected = {}) {
|
|||
city: 'Chapel Hill',
|
||||
dependentLocality: '',
|
||||
postalCode: '6095',
|
||||
region: 'QLD',
|
||||
sortingCode: '',
|
||||
organization: 'w3c',
|
||||
recipient: 'web platform test',
|
||||
|
|
|
@ -16,7 +16,14 @@ function runTest(button, options, expected){
|
|||
await response.retry({ error });
|
||||
const event = await eventPromise;
|
||||
assert_true(event instanceof PaymentRequestUpdateEvent);
|
||||
for(const [prop, value] of Object.entries(expected)){
|
||||
for([prop, value] of Object.entries(expected)){
|
||||
if (prop === 'payerPhone') {
|
||||
// |payerPhone| may optionally adhere to E164 structure, which does not
|
||||
// contain formatting, e.g. +180000000 instead of +1-800-000-0000.
|
||||
// Strip out the formatting in case the user agent implements E164.
|
||||
// https://w3c.github.io/payment-request/#addressinit-dictionary
|
||||
value = value.replace(/[-\(\) ]/g, '');
|
||||
}
|
||||
assert_equals(response[prop], value);
|
||||
}
|
||||
await response.complete("success");
|
||||
|
@ -52,7 +59,7 @@ function runTest(button, options, expected){
|
|||
<p>
|
||||
Change payer's phone to "+1-800-000-0000".
|
||||
</p>
|
||||
<button onclick="runTest(this, {requestPayerPhone: true}, { payerPhone: '+1-800-000-0000' })">
|
||||
<button onclick="runTest(this, {requestPayerPhone: true}, { payerPhone: '+18000000000' })">
|
||||
PaymentRequestUpdateEvent is dispatched when payer phone changes.
|
||||
</button>
|
||||
</li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue