Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html

Issue 2844463002: PaymentHandler: Implement PaymentInstruments.delete(). (Closed)
Patch Set: PaymentHandler: Implement PaymentInstruments.delete(). Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <meta charset="utf-8"> 2 <meta charset="utf-8">
3 <title>PaymentHandler: Tests for PaymentInstruments</title> 3 <title>PaymentHandler: Tests for PaymentInstruments</title>
4 <link rel="help" href="https://w3c.github.io/webpayments-payment-apps-api/#payme nt-instruments"> 4 <link rel="help" href="https://w3c.github.io/webpayments-payment-apps-api/#payme nt-instruments">
5 <script src="../resources/testharness.js"></script> 5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script> 6 <script src="../resources/testharnessreport.js"></script>
7 <script src="../../serviceworker/resources/test-helpers.js"></script> 7 <script src="../../serviceworker/resources/test-helpers.js"></script>
8 <script> 8 <script>
9 9
10 promise_test(test => { 10 promise_test(test => {
(...skipping 27 matching lines...) Expand all
38 assert_equals(stored_instrument.name, 'Visa ending ****4756'); 38 assert_equals(stored_instrument.name, 'Visa ending ****4756');
39 assert_array_equals(stored_instrument.enabledMethods, ['basic-card']); 39 assert_array_equals(stored_instrument.enabledMethods, ['basic-card']);
40 assert_object_equals(stored_instrument.capabilities, { 40 assert_object_equals(stored_instrument.capabilities, {
41 supportedNetworks: ['visa'], 41 supportedNetworks: ['visa'],
42 supportedTypes: ['credit'] 42 supportedTypes: ['credit']
43 }); 43 });
44 }) 44 })
45 .catch(unreached_rejection(test)); 45 .catch(unreached_rejection(test));
46 }, 'PaymentInstruments set/get methods test'); 46 }, 'PaymentInstruments set/get methods test');
47 47
48 promise_test(test => {
49 var registration;
50 var script_url = 'resources/empty-worker.js';
51 var scope = 'resources/';
52
53 return service_worker_unregister_and_register(test, script_url, scope)
54 .then(r => {
55 registration = r;
56 return wait_for_state(test, registration.installing, 'activated');
57 })
58 .then(state => {
59 assert_equals(state, 'activated');
60 return registration.paymentManager.instruments.set(
61 'test_key',
62 {
63 name: 'Visa ending ****4756',
64 enabledMethods: ['basic-card'],
65 capabilities: {
66 supportedNetworks: ['visa'],
67 supportedTypes: ['credit']
68 }
69 });
70 })
71 .then(result => {
72 assert_equals(result, undefined);
73 return registration.paymentManager.instruments.delete('test_key');
74 })
75 .then(result => {
76 assert_equals(result, true);
77 return registration.paymentManager.instruments.delete('test_key');
78 })
79 .then(result => {
80 assert_equals(result, false);
81 })
82 .catch(unreached_rejection(test));
83 }, 'PaymentInstruments delete method test');
84
48 </script> 85 </script>
OLDNEW
« no previous file with comments | « content/browser/payments/payment_manager_unittest.cc ('k') | third_party/WebKit/Source/modules/payments/PaymentInstruments.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698