| Index: third_party/WebKit/LayoutTests/payments/payment-request-interface.html
|
| diff --git a/third_party/WebKit/LayoutTests/payments/payment-request-interface.html b/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
|
| index f58060876c73338cf78273f84365af0323728fd5..c0854654bec17714e7211eaed86cbd6ef52c9da9 100644
|
| --- a/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
|
| +++ b/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
|
| @@ -167,65 +167,17 @@ test(function() {
|
| }, 'Non-negative total value should not throw.');
|
|
|
| test(function() {
|
| - assert_throws(new TypeError(), function() {
|
| - new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails('total', {'value': '-0.01'}));
|
| - });
|
| -}, 'Negative total value should throw a TypeError.');
|
| -
|
| -test(function() {
|
| new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails('displayItems.0', {'value': '-0.01'}));
|
| }, 'Negative line item value should not throw.');
|
|
|
| test(function() {
|
| - assert_throws(new TypeError(), function() {
|
| - new PaymentRequest([{'supportedMethods': ['foo']}], {'displayItems': [buildItem()]});
|
| - });
|
| -}, 'Absence of total should throw TypeError.');
|
| -
|
| -test(function() {
|
| new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': undefined});
|
| }, 'Undefined modifiers should not throw.');
|
|
|
| test(function() {
|
| - assert_throws(new TypeError(), function() {
|
| - new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': []});
|
| - });
|
| -}, 'Empty modifiers should throw TypeError.');
|
| -
|
| -test(function() {
|
| - assert_throws(new TypeError(), function() {
|
| - new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'total': buildItem()}]});
|
| - });
|
| -}, 'Absence of supportedMethods in modifiers should throw TypeError.');
|
| -
|
| -test(function() {
|
| - assert_throws(new TypeError(), function() {
|
| - new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': []}]});
|
| - });
|
| -}, 'Empty supportedMethods in modifiers should throw TypeError.');
|
| -
|
| -test(function() {
|
| - assert_throws(new TypeError(), function() {
|
| - new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': undefined}]});
|
| - });
|
| -}, 'Undefined supportedMethods in modifiers should throw TypeError.');
|
| -
|
| -test(function() {
|
| - assert_throws(new TypeError(), function() {
|
| - new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': null}]});
|
| - });
|
| -}, 'Null supportedMethods in modifiers should throw TypeError.');
|
| -
|
| -test(function() {
|
| new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo'], 'total': buildItem({'value': '0.0'})}]});
|
| }, 'Non-negative total value in PaymentDetailsModifier should not throw.');
|
|
|
| -test(function() {
|
| - assert_throws(new TypeError(), function() {
|
| - new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo'], 'total': buildItem({'value': '-0.01'})}]});
|
| - });
|
| -}, 'Negative total value in PaymentDetailsModifier should throw a TypeError.');
|
| -
|
| promise_test(function(t) {
|
| return promise_rejects(t, null, new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails()).abort());
|
| }, 'abort() without show() should reject with error');
|
| @@ -252,12 +204,36 @@ generate_tests(assert_throws, [
|
| ['Duplicate supported payment method identifiers should throw TypeError.', null, function() {
|
| new PaymentRequest([{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}], buildDetails(), {})
|
| }],
|
| + ['Absence of total should throw TypeError.', null, function() {
|
| + new PaymentRequest([{'supportedMethods': ['foo']}], {'displayItems': [buildItem()]})
|
| + }],
|
| + ['Negative total value should throw a TypeError.', null, function() {
|
| + new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails('total', {'value': '-0.01'}))
|
| + }],
|
| ['Duplicate supported payment method identifiers in modifiers should throw TypeError.', null, function() {
|
| new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo', 'foo']}]})
|
| }],
|
| ['Duplicate supported payment method identifiers in modifiers should throw TypeError.', null, function() {
|
| new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}]})
|
| }],
|
| + ['Negative total value in PaymentDetailsModifier should throw a TypeError.', null, function() {
|
| + new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo'], 'total': buildItem({'value': '-0.01'})}]})
|
| + }],
|
| + ['Null supportedMethods in modifiers should throw TypeError.', null, function() {
|
| + new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': null}]})
|
| + }],
|
| + ['Undefined supportedMethods in modifiers should throw TypeError.', null, function() {
|
| + new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': undefined}]})
|
| + }],
|
| + ['Empty supportedMethods in modifiers should throw TypeError.', null, function() {
|
| + new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': []}]})
|
| + }],
|
| + ['Absence of supportedMethods in modifiers should throw TypeError.', null, function() {
|
| + new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'total': buildItem()}]})
|
| + }],
|
| + ['Empty modifiers should throw TypeError.', null, function() {
|
| + new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': []})
|
| + }],
|
| ['Empty details should throw', null, function() {
|
| new PaymentRequest([{'supportedMethods': ['foo']}], {})
|
| }],
|
|
|