Commit b24d35ae authored by rouslan's avatar rouslan Committed by Commit bot

Fix harness error in payment-request-interface.html layout test.

BUG=705252

Review-Url: https://codereview.chromium.org/2850183002
Cr-Commit-Position: refs/heads/master@{#468363}
parent e2db5397
......@@ -226,7 +226,7 @@ test(function() {
test(function() {
new PaymentRequest([{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}], buildDetails(), {});
}, 'Duplicate supported payment method identifiers should not throw.');
}, 'Duplicate supported payment method identifiers in separate methodData objects should not throw.');
test(function() {
new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo', 'foo']}]});
......@@ -234,7 +234,7 @@ test(function() {
test(function() {
new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}]});
}, 'Duplicate supported payment method identifiers in modifiers should not throw.');
}, 'Duplicate supported payment method identifiers in separate methoData objects of modifiers should not throw.');
test(function() {
new PaymentRequest([{'supportedMethods': ['https://android.com/pay'], 'data': {'environment': 'TEST', 'merchantName': 'Merchant Inc', 'merchantId': '123', 'allowedCardNetworks': ['AMEX', 'DISCOVER', 'MASTERCARD', 'VISA'], 'paymentMethodTokenizationParameters': {'tokenizationType': 'GATEWAY_TOKEN', 'parameters': {'key': 'value'}}}}], buildDetails());
......@@ -368,51 +368,51 @@ var detailNames = ['total', 'displayItems.0', 'shippingOptions.0', 'modifiers.0.
for (var i in detailNames) {
generate_tests(assert_throws, [
// Invalid currency code formats.
['Undefined currency code should throw', null, function() {
['Undefined currency code in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'currency': undefined}), {requestShipping: true})
}],
// Invalid amount formats.
['Invalid amount "-" should throw', null, function() {
['Invalid amount "-" in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': '-'}), {requestShipping: true})
}],
['Invalid amount "notdigits" should throw', null, function() {
['Invalid amount "notdigits" in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': 'notdigits'}), {requestShipping: true})
}],
['Invalid amount "ALSONOTDIGITS" should throw', null, function() {
['Invalid amount "ALSONOTDIGITS" in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': 'ALSONOTDIGITS'}), {requestShipping: true})
}],
['Invalid amount "10." should throw', null, function() {
['Invalid amount "10." in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': '10.'}), {requestShipping: true})
}],
['Invalid amount ".99" should throw', null, function() {
['Invalid amount ".99" in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': '.99'}), {requestShipping: true})
}],
['Invalid amount "-10." should throw', null, function() {
['Invalid amount "-10." in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': '-10.'}), {requestShipping: true})
}],
['Invalid amount "-.99" should throw', null, function() {
['Invalid amount "-.99" in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': '-.99'}), {requestShipping: true})
}],
['Invalid amount "10-" should throw', null, function() {
['Invalid amount "10-" in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': '10-'}), {requestShipping: true})
}],
['Invalid amount "1-0" should throw', null, function() {
['Invalid amount "1-0" in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': '1-0'}), {requestShipping: true})
}],
['Invalid amount "1.0.0" should throw', null, function() {
['Invalid amount "1.0.0" in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': '1.0.0'}), {requestShipping: true})
}],
['Invalid amount "1/3" should throw', null, function() {
['Invalid amount "1/3" in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': '1/3'}), {requestShipping: true})
}],
['Empty amount should throw', null, function() {
['Empty amount in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': ''}), {requestShipping: true})
}],
['Null amount should throw', null, function() {
['Null amount in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': null}), {requestShipping: true})
}],
['Undefined amount should throw', null, function() {
['Undefined amount in ' + detailNames[i] + ' should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(detailNames[i], {'value': undefined}), {requestShipping: true})
}],
]);
......
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