Skip to content

Commit

Permalink
[basic-card] Migrate WPTs that use basic-card identifier
Browse files Browse the repository at this point in the history
With basic card now disabled and soon to be removed, migrate web
platform tests that test the payment method identifier syntax to use
secure-payment-confirmation instead of basic-card. These tests pass
either way, this is just to refresh the test data to a current feature.

The merchant-validation test is also updated, in addition to the
similar PMI validation change, it is updated to use an example URL
payment method.

Bug: 1209835
Change-Id: I109e9063720c21d10c5c0af1f765d553eaadeb83
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3556267
Reviewed-by: Rouslan Solomakhin <[email protected]>
Commit-Queue: Nick Burris <[email protected]>
Cr-Commit-Position: refs/heads/main@{#986998}
  • Loading branch information
Nick Burris authored and chromium-wpt-export-bot committed Mar 30, 2022
1 parent 568dd14 commit 19cfa44
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
12 changes: 6 additions & 6 deletions merchant-validation/constructor.tentative.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
supportedNetworks: ["visa"],
}
});
const basicCard = Object.freeze({ supportedMethods: "basic-card" });
const defaultMethods = Object.freeze([basicCard, applePay]);
const examplePay = Object.freeze({ supportedMethods: "https://example.com/pay" });
const defaultMethods = Object.freeze([examplePay, applePay]);
const defaultDetails = Object.freeze({
total: {
label: "Total",
Expand Down Expand Up @@ -110,7 +110,7 @@
"https://example.com/pay",
"https://example.com/pay?version=1",
"https://example.com/pay/version/1",
"basic-card",
"secure-payment-confirmation",
"https://apple.com/apple-pay",
// special case for as default value
"",
Expand All @@ -124,11 +124,11 @@
test(() => {
const invalidPMIs = [
// ❌ Contains Unicode character outside the valid ranges.
"basic-💳",
"secure-💳",
// ❌ Contains uppercase characters.
"Basic-Card",
"Secure-Payment-Confirmation",
// ❌ Contains Unicode characters outside the valid ranges.
basic-*-card!",
secure-*-payment-confirmation!",
// ❌ Uses http://, a username, and a password.
"http://username:[email protected]/pay",
// ❌ Uses unknown URI scheme.
Expand Down
26 changes: 13 additions & 13 deletions payment-method-id/payment-request-ctor-pmi-handling.https.sub.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
"u4-n-t",
"i488jh6-g18-fck-yb-v7-i",
"x-x-t-t-c34-o",
"basic-card",
// gets coerced to "basic-card", for compat with old version of spec
["basic-card"],
"secure-payment-confirmation",
// gets coerced to "secure-payment-confirmation", for compat with old version of spec
["secure-payment-confirmation"],
];
for (const validMethod of validMethods) {
try {
Expand All @@ -77,9 +77,9 @@

test(() => {
const invalidMethods = [
"basic-💳",
basic-*-card!",
"Basic-Card",
"secure-💳",
secure-*-payment-confirmation!",
"Secure-Payment-Confirmation",
"0",
"-",
"--",
Expand All @@ -98,13 +98,13 @@
"\t\na-b",
"a-b ",
"a-b\n\t",
"basic-card?not-really",
"basic-card://not-ok",
"basic card",
"/basic card/",
"BaSicCarD",
"BASIC-CARD",
" basic-card ",
"secure-payment-confirmation?not-really",
"secure-payment-confirmation://not-ok",
"secure payment confirmation",
"/secure payment confirmation/",
"SeCuRePaYmEnTcOnFiRmAtIoN",
"SECURE-PAYMENT-CONFIRMATION",
" secure-payment-confirmation ",
"this is not supported",
" ",
"foo,var",
Expand Down
26 changes: 13 additions & 13 deletions payment-request/payment-request-ctor-pmi-handling.https.sub.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
"u4-n-t",
"i488jh6-g18-fck-yb-v7-i",
"x-x-t-t-c34-o",
"basic-card",
// gets coerced to "basic-card", for compat with old version of spec
["basic-card"],
"secure-payment-confirmation",
// gets coerced to "secure-payment-confirmation", for compat with old version of spec
["secure-payment-confirmation"],
];
for (const validMethod of validMethods) {
try {
Expand All @@ -77,9 +77,9 @@

test(() => {
const invalidMethods = [
"basic-💳",
basic-*-card!",
"Basic-Card",
"secure-💳",
secure-*-payment-confirmation!",
"Secure-Payment-Confirmation",
"0",
"-",
"--",
Expand All @@ -98,13 +98,13 @@
"\t\na-b",
"a-b ",
"a-b\n\t",
"basic-card?not-really",
"basic-card://not-ok",
"basic card",
"/basic card/",
"BaSicCarD",
"BASIC-CARD",
" basic-card ",
"secure-payment-confirmation?not-really",
"secure-payment-confirmation://not-ok",
"secure payment confirmation",
"/secure payment confirmation/",
"SeCuRePaYmEnTcOnFiRmAtIoN",
"SECURE-PAYMENT-CONFIRMATION",
" secure-payment-confirmation ",
"this is not supported",
" ",
"foo,var",
Expand Down

0 comments on commit 19cfa44

Please sign in to comment.