Index: third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html b/third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html |
index e52f67ec927f7723824fac31634605694e9b0d84..7f6c7fbf89d00e5cf05cd1e69c2f9616d6b2b6d4 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html |
@@ -45,4 +45,41 @@ promise_test(test => { |
.catch(unreached_rejection(test)); |
}, 'PaymentInstruments set/get methods test'); |
+promise_test(test => { |
+ var registration; |
+ var script_url = 'resources/empty-worker.js'; |
+ var scope = 'resources/'; |
+ |
+ return service_worker_unregister_and_register(test, script_url, scope) |
+ .then(r => { |
+ registration = r; |
+ return wait_for_state(test, registration.installing, 'activated'); |
+ }) |
+ .then(state => { |
+ assert_equals(state, 'activated'); |
+ return registration.paymentManager.instruments.set( |
+ 'test_key', |
+ { |
+ name: 'Visa ending ****4756', |
+ enabledMethods: ['basic-card'], |
+ capabilities: { |
+ supportedNetworks: ['visa'], |
+ supportedTypes: ['credit'] |
+ } |
+ }); |
+ }) |
+ .then(result => { |
+ assert_equals(result, undefined); |
+ return registration.paymentManager.instruments.delete('test_key'); |
+ }) |
+ .then(result => { |
+ assert_equals(result, true); |
+ return registration.paymentManager.instruments.delete('test_key'); |
+ }) |
+ .then(result => { |
+ assert_equals(result, false); |
+ }) |
+ .catch(unreached_rejection(test)); |
+ }, 'PaymentInstruments delete method test'); |
+ |
</script> |