Commit 4fb20b8a authored by Rouslan Solomakhin's avatar Rouslan Solomakhin Committed by Commit Bot

[Web Payment] Very long instrumentId string test.

This patch adds a test for JSON serialization of a very long string
being passed into PaymentRequest API.

Bug: 1110324, 1115091
Change-Id: I7966d71c3752d1e4378a54f534a1915fb8fade39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2348411
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: default avatarNick Burris <nburris@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797165}
parent a65f867e
......@@ -174,4 +174,20 @@ test(() => {
}], details);
});
}, 'Timeout longer than 1 hour throws exception.');
test(() => {
assert_throws_js(TypeError, () => {
new PaymentRequest([{
supportedMethods: 'secure-payment-confirmation',
data: {
action: 'authenticate',
// Large instrumentId value.
instrumentId: 'x'.repeat(1024 * 1024),
networkData: Uint8Array.from('x', c => c.charCodeAt(0)),
timeout: 60000,
fallbackUrl: 'https://fallback.example/url'
},
}], details);
});
}, 'Large instrumentId value throws exception.');
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment