[Payment Request] Correctly rejects show() and canMakePayment() promises

Desktop / Chromium - Mohamad Ahmadi [chromium.org] - 10 August 2017 08:53 EDT

- Rejects the promises returned by show() and canMakePayment() with the appropriate error names and messages.
- Modify the tests when the promise returned by show() is rejected.
- Adds tests for canMakePayment().

Bug: 602666 Change-Id: Ie54157fa4d6f404ba9e7144f9e42585a6f59df9a Reviewed-on: https://chromium-review.googlesource.com/583428 Commit-Queue: mahmadi

4769a14 [Payment Request] Correctly rejects show() and canMakePayment() promises.
components/test/data/payments/abort.js | 4 +-
.../browser/payments/origin_security_checker.h | 6 +
.../browser/payments/origin_security_checker.mm | 12 ++
ios/chrome/browser/ui/payments/BUILD.gn | 2 +
.../ui/payments/js_payment_request_manager.h | 36 ++--
.../ui/payments/js_payment_request_manager.mm | 54 ++++--
.../payment_request_can_make_payment_egtest.mm | 200 +++++++++++++++++++++
.../payment_request_cancel_pay_abort_egtest.mm | 12 +-
.../ui/payments/payment_request_data_url_egtest.mm | 75 ++++++++
.../browser/ui/payments/payment_request_manager.h | 10 +-
.../browser/ui/payments/payment_request_manager.mm | 100 +++++++----
.../browser/web/resources/payment_request.js | 20 ++-
12 files changed, 455 insertions(+), 76 deletions(-)

Upstream: git.chromium.org


  • Share