Summary

Harness status: OK

Found 17 tests

Details

ResultTest NameMessage
FailEmpty credentialIds field throws exception.assert_throws_js: function "() => { new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { relyingPartyId: 'relying-party.example', // Empty credentialIds field. credentialIds: [], challenge: Uint8Array.from('x', c => c.charCodeAt(0)), payeeOrigin: window.location.origin, timeout: 60000, instrument: { displayName: 'X', icon: 'https://example.test/icon.png', }, rpId: 'relying-party.example', }, }], details); }" did not throw
    at Test.<anonymous> (https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:19:3)
    at Test.step (https://wpt.live/resources/testharness.js:2642:25)
    at test (https://wpt.live/resources/testharness.js:633:30)
    at https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:18:1
Asserts run
Fail
assert_throws_js(function "function RangeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         relyingPartyId: 'relying-party.example',         // Empty credentialIds field.         credentialIds: [],         challenge: Uint8Array.from('x', c => c.charCodeAt(0)),         payeeOrigin: window.location.origin,         timeout: 60000,         instrument: {           displayName: 'X',           icon: 'https://example.test/icon.png',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:19:3)
FailEmpty ID within credentialIds field throws exception.assert_throws_js: function "() => { new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { relyingPartyId: 'relying-party.example', credentialIds: [ Uint8Array.from('c1', c => c.charCodeAt(0)), new Uint8Array(), // Empty Uint8Array.from('c2', c => c.charCodeAt(0)), ], challenge: Uint8Array.from('x', c => c.charCodeAt(0)), payeeOrigin: window.location.origin, timeout: 60000, instrument: { displayName: 'X', icon: 'https://example.test/icon.png', }, rpId: 'relying-party.example', }, }], details); }" did not throw
    at Test.<anonymous> (https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:40:3)
    at Test.step (https://wpt.live/resources/testharness.js:2642:25)
    at test (https://wpt.live/resources/testharness.js:633:30)
    at https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:39:1
Asserts run
Fail
assert_throws_js(function "function RangeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         relyingPartyId: 'relying-party.example',         credentialIds: [           Uint8Array.from('c1', c => c.charCodeAt(0)),           new Uint8Array(),  // Empty           Uint8Array.from('c2', c => c.charCodeAt(0)),         ],         challenge: Uint8Array.from('x', c => c.charCodeAt(0)),         payeeOrigin: window.location.origin,         timeout: 60000,         instrument: {           displayName: 'X',           icon: 'https://example.test/icon.png',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:40:3)
PassMultiple IDs in credentialIds is valid.
Asserts runNo asserts ran
PassLarge credentialIds value throws exception.
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         // Large credentialIds value.         credentialIds: [Uint8Array.from(             'x'.repeat(1024 * 1024), c => c.charCodeAt(0))],         challenge: Uint8Array.from('x', c => c.charCodeAt(0)),         payeeOrigin: window.location.origin,         timeout: 60000,         instrument: {           displayName: 'X',           icon: 'https://example.test/icon.png',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:85:3)
FailNull challenge field throws exception.assert_throws_js: function "() => { new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))], // Null challenge fields. challenge: null, payeeOrigin: window.location.origin, timeout: 60000, instrument: { displayName: 'X', icon: 'https://example.test/icon.png', }, rpId: 'relying-party.example', }, }], details); }" did not throw
    at Test.<anonymous> (https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:106:3)
    at Test.step (https://wpt.live/resources/testharness.js:2642:25)
    at test (https://wpt.live/resources/testharness.js:633:30)
    at https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:105:1
Asserts run
Fail
assert_throws_js(function "function TypeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))],         // Null challenge fields.         challenge: null,         payeeOrigin: window.location.origin,         timeout: 60000,         instrument: {           displayName: 'X',           icon: 'https://example.test/icon.png',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:106:3)
FailEmpty challenge field throws exception.assert_throws_js: function "() => { new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))], // Empty challenge fields. challenge: [], payeeOrigin: window.location.origin, timeout: 60000, instrument: { displayName: 'X', icon: 'https://example.test/icon.png', }, rpId: 'relying-party.example', }, }], details); }" did not throw
    at Test.<anonymous> (https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:126:3)
    at Test.step (https://wpt.live/resources/testharness.js:2642:25)
    at test (https://wpt.live/resources/testharness.js:633:30)
    at https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:125:1
Asserts run
Fail
assert_throws_js(function "function TypeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))],         // Empty challenge fields.         challenge: [],         payeeOrigin: window.location.origin,         timeout: 60000,         instrument: {           displayName: 'X',           icon: 'https://example.test/icon.png',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:126:3)
PassLarge challenge value throws exception.
Asserts run
Pass
assert_throws_js(function "function TypeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))],         // Large challenge value.         challenge: Uint8Array.from('x'.repeat(1024 * 1024), c => c.charCodeAt(0)),         payeeOrigin: window.location.origin,         timeout: 60000,         instrument: {           displayName: 'X',           icon: 'https://example.test/icon.png',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:146:3)
FailEmpty instrument.displayName field throws exception.assert_throws_js: function "() => { new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))], challenge: Uint8Array.from('x', c => c.charCodeAt(0)), payeeOrigin: window.location.origin, timeout: 60000, instrument: { displayName: '', icon: 'https://example.test/icon.png', }, rpId: 'relying-party.example', }, }], details); }" did not throw
    at Test.<anonymous> (https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:166:3)
    at Test.step (https://wpt.live/resources/testharness.js:2642:25)
    at test (https://wpt.live/resources/testharness.js:633:30)
    at https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:165:1
Asserts run
Fail
assert_throws_js(function "function TypeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))],         challenge: Uint8Array.from('x', c => c.charCodeAt(0)),         payeeOrigin: window.location.origin,         timeout: 60000,         instrument: {           displayName: '',           icon: 'https://example.test/icon.png',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:166:3)
FailEmpty instrument.icon field throws exception.assert_throws_js: function "() => { new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))], challenge: Uint8Array.from('x', c => c.charCodeAt(0)), payeeOrigin: window.location.origin, timeout: 60000, instrument: { displayName: 'X', icon: '', }, rpId: 'relying-party.example', }, }], details); }" did not throw
    at Test.<anonymous> (https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:185:3)
    at Test.step (https://wpt.live/resources/testharness.js:2642:25)
    at test (https://wpt.live/resources/testharness.js:633:30)
    at https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:184:1
Asserts run
Fail
assert_throws_js(function "function TypeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))],         challenge: Uint8Array.from('x', c => c.charCodeAt(0)),         payeeOrigin: window.location.origin,         timeout: 60000,         instrument: {           displayName: 'X',           icon: '',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:185:3)
FailInvalid instrument.icon URL throws exception.assert_throws_js: function "() => { new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))], challenge: Uint8Array.from('x', c => c.charCodeAt(0)), payeeOrigin: window.location.origin, timeout: 60000, instrument: { displayName: 'X', icon: 'thisisnotaurl', }, rpId: 'relying-party.example', }, }], details); }" did not throw
    at Test.<anonymous> (https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:204:3)
    at Test.step (https://wpt.live/resources/testharness.js:2642:25)
    at test (https://wpt.live/resources/testharness.js:633:30)
    at https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:203:1
Asserts run
Fail
assert_throws_js(function "function TypeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))],         challenge: Uint8Array.from('x', c => c.charCodeAt(0)),         payeeOrigin: window.location.origin,         timeout: 60000,         instrument: {           displayName: 'X',           icon: 'thisisnotaurl',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:204:3)
FailInvalid rpId field throws exception.assert_throws_js: function "() => { new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))], challenge: Uint8Array.from('x', c => c.charCodeAt(0)), payeeOrigin: window.location.origin, timeout: 60000, instrument: { displayName: 'X', icon: 'https://example.test/icon.png', }, rpId: 'domains cannot have spaces.com', }, }], details); }" did not throw
    at Test.<anonymous> (https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:223:3)
    at Test.step (https://wpt.live/resources/testharness.js:2642:25)
    at test (https://wpt.live/resources/testharness.js:633:30)
    at https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:222:1
Asserts run
Fail
assert_throws_js(function "function TypeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))],         challenge: Uint8Array.from('x', c => c.charCodeAt(0)),         payeeOrigin: window.location.origin,         timeout: 60000,         instrument: {           displayName: 'X',           icon: 'https://example.test/icon.png',         },         rpId: 'domains cannot have spaces.com',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:223:3)
FailOmitting both payee origin and payee name throws exception.assert_throws_js: function "() => { new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { // Omitted payee origin and payee name. credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))], challenge: Uint8Array.from('x', c => c.charCodeAt(0)), timeout: 60000, instrument: { displayName: 'X', icon: 'https://example.test/icon.png', }, rpId: 'relying-party.example', }, }], details); }" did not throw
    at Test.<anonymous> (https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:242:3)
    at Test.step (https://wpt.live/resources/testharness.js:2642:25)
    at test (https://wpt.live/resources/testharness.js:633:30)
    at https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:241:1
Asserts run
Fail
assert_throws_js(function "function TypeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         // Omitted payee origin and payee name.         credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))],         challenge: Uint8Array.from('x', c => c.charCodeAt(0)),         timeout: 60000,         instrument: {           displayName: 'X',           icon: 'https://example.test/icon.png',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:242:3)
PassPayee name without payee origin is valid.
Asserts runNo asserts ran
PassProviding both payee name and payee origin is valid.
Asserts runNo asserts ran
FailEmpty payee name throws exception.assert_throws_js: function "() => { new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))], challenge: Uint8Array.from('x', c => c.charCodeAt(0)), // Empty payee name payeeName: '', payeeOrigin: window.location.origin, timeout: 60000, instrument: { displayName: 'X', icon: 'https://example.test/icon.png', }, rpId: 'relying-party.example', }, }], details); }" did not throw
    at Test.<anonymous> (https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:298:3)
    at Test.step (https://wpt.live/resources/testharness.js:2642:25)
    at test (https://wpt.live/resources/testharness.js:633:30)
    at https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:297:1
Asserts run
Fail
assert_throws_js(function "function TypeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))],         challenge: Uint8Array.from('x', c => c.charCodeAt(0)),         // Empty payee name         payeeName: '',         payeeOrigin: window.location.origin,         timeout: 60000,         instrument: {           displayName: 'X',           icon: 'https://example.test/icon.png',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:298:3)
FailEmpty payee origin throws exception.assert_throws_js: function "() => { new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))], challenge: Uint8Array.from('x', c => c.charCodeAt(0)), payeeName: 'Example Merchant', // Empty payee origin payeeOrigin: '', timeout: 60000, instrument: { displayName: 'X', icon: 'https://example.test/icon.png', }, rpId: 'relying-party.example', }, }], details); }" did not throw
    at Test.<anonymous> (https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:319:3)
    at Test.step (https://wpt.live/resources/testharness.js:2642:25)
    at test (https://wpt.live/resources/testharness.js:633:30)
    at https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:318:1
Asserts run
Fail
assert_throws_js(function "function TypeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))],         challenge: Uint8Array.from('x', c => c.charCodeAt(0)),         payeeName: 'Example Merchant',         // Empty payee origin         payeeOrigin: '',         timeout: 60000,         instrument: {           displayName: 'X',           icon: 'https://example.test/icon.png',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:319:3)
FailNon-HTTPS payee origin throws exception.assert_throws_js: function "() => { new PaymentRequest([{ supportedMethods: 'secure-payment-confirmation', data: { credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))], challenge: Uint8Array.from('x', c => c.charCodeAt(0)), payeeName: 'Example Merchant', payeeOrigin: 'http://thepayee.com', timeout: 60000, instrument: { displayName: 'X', icon: 'https://example.test/icon.png', }, rpId: 'relying-party.example', }, }], details); }" did not throw
    at Test.<anonymous> (https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:340:3)
    at Test.step (https://wpt.live/resources/testharness.js:2642:25)
    at test (https://wpt.live/resources/testharness.js:633:30)
    at https://wpt.live/secure-payment-confirmation/constructor-validate-payment-method-data.https.html:339:1
Asserts run
Fail
assert_throws_js(function "function TypeError() { [native code] }", function "() => {     new PaymentRequest([{       supportedMethods: 'secure-payment-confirmation',       data: {         credentialIds: [Uint8Array.from('x', c => c.charCodeAt(0))],         challenge: Uint8Array.from('x', c => c.charCodeAt(0)),         payeeName: 'Example Merchant',         payeeOrigin: 'http://thepayee.com',         timeout: 60000,         instrument: {           displayName: 'X',           icon: 'https://example.test/icon.png',         },         rpId: 'relying-party.example',       },     }], details);   }")
    at Test.<anonymous> ( /secure-payment-confirmation/constructor-validate-payment-method-data.https.html:340:3)