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

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

Issue 2844673002: PaymentHandler: Implement PaymentInstruments.has(). (Closed)
Patch Set: PaymentHandler: Implement PaymentInstruments.has(). 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 side-by-side diff with in-line comments
Download patch
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 7f6c7fbf89d00e5cf05cd1e69c2f9616d6b2b6d4..8f36fcaf5e9f7e494e4f6a16157e7c86a40ccd60 100644
--- a/third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html
+++ b/third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html
@@ -82,4 +82,41 @@ promise_test(test => {
.catch(unreached_rejection(test));
}, 'PaymentInstruments delete 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');
+ 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.has('test_key');
+ })
+ .then(result => {
+ assert_equals(result, true);
+ return registration.paymentManager.instruments.has('unstored_test_key');
+ })
+ .then(result => {
+ assert_equals(result, false);
+ })
+ .catch(unreached_rejection(test));
+ }, 'PaymentInstruments |has| method test');
+
</script>
« 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