| 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 8b2c06bf9ea8da198c49ac2140b444fdbe99689e..1e01ca6bc6a570f056af6e306e4d658db93a7645 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html
|
| @@ -161,4 +161,54 @@ promise_test(test => {
|
| .catch(unreached_rejection(test));
|
| }, 'PaymentInstruments |keys| method 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');
|
| + var instruments = [
|
| + registration.paymentManager.instruments.set(
|
| + 'test_key1',
|
| + {
|
| + name: 'Visa ending ****4756',
|
| + enabledMethods: ['basic-card'],
|
| + capabilities: {
|
| + supportedNetworks: ['visa'],
|
| + supportedTypes: ['credit']
|
| + }
|
| + }),
|
| + registration.paymentManager.instruments.set(
|
| + 'test_key2',
|
| + {
|
| + name: "My Bob Pay Account: john@example.com",
|
| + enabledMethods: ["https://bobpay.com/"]
|
| + })
|
| + ];
|
| + return Promise.all(instruments);
|
| + })
|
| + .then(result => {
|
| + assert_array_equals(result, [undefined, undefined]);
|
| + return registration.paymentManager.instruments.keys();
|
| + })
|
| + .then(result => {
|
| + assert_equals(result.length, 2);
|
| + return registration.paymentManager.instruments.clear();
|
| + })
|
| + .then(result => {
|
| + assert_equals(result, undefined);
|
| + return registration.paymentManager.instruments.keys();
|
| + })
|
| + .then(result => {
|
| + assert_equals(result.length, 0);
|
| + })
|
| + .catch(unreached_rejection(test));
|
| + }, 'PaymentInstruments |clear| method test');
|
| +
|
| </script>
|
|
|