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

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

Issue 2811163002: PaymentHandler: Add a js test for PaymentInstruments get/set methods (Closed)
Patch Set: rebased 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <meta charset="utf-8">
3 <title>PaymentHandler: Tests for PaymentInstruments</title>
4 <link rel="help" href="https://w3c.github.io/webpayments-payment-apps-api/#payme nt-instruments">
5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script>
7 <script src="../../serviceworker/resources/test-helpers.js"></script>
8 <script>
9
10 promise_test(test => {
11 var registration;
12 var script_url = 'resources/empty-worker.js';
13 var scope = 'resources/';
14
15 return service_worker_unregister_and_register(test, script_url, scope)
16 .then(r => {
17 registration = r;
18 return wait_for_state(test, registration.installing, 'activated');
19 })
20 .then(state => {
21 assert_equals(state, 'activated');
22 return registration.paymentManager.instruments.set(
23 'test_key',
24 {
25 name: 'Visa ending ****4756',
26 enabledMethods: ['basic-card'],
27 capabilities: {
28 supportedNetworks: ['visa'],
29 supportedTypes: ['credit']
30 }
31 });
32 })
33 .then(result => {
34 assert_equals(result, undefined);
35 return registration.paymentManager.instruments.get('test_key');
36 })
37 .then(stored_instrument => {
38 assert_equals(stored_instrument.name, 'Visa ending ****4756');
39 assert_array_equals(stored_instrument.enabledMethods, ['basic-card']);
40 assert_object_equals(stored_instrument.capabilities, {
41 supportedNetworks: ['visa'],
42 supportedTypes: ['credit']
43 });
44 })
45 .catch(unreached_rejection(test));
46 }, 'PaymentInstruments set/get methods test');
47
48 </script>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698