• Danyao Wang's avatar
    [Web Payments] Add canMakePayment tests for Secure Payment Confirmation. · 5c38b304
    Danyao Wang authored
    Both canMakePayment() and hasEnrolledInstrument() are expected to return
    true if a device supports Secure Payment Confirmation: i.e. has a
    compatible authenticator, regardless of the presence of payment
    credentials. These new tests verify these behaviors.
    
    Also fixed a crash that happens when PaymentRequest is destroyed after
    the associated RenderFrameHost. This is new to Secure Payment
    Confirmation because PaymentRequest now holds an InternalAuthenticator,
    which must be out-lived by the RenderFrameHost. This patch fixes the
    bug by observing WebContentsObserver::RenderFrameDeleted() and perform
    the necessary clean up before the RenderFrameHost is actually destroyed.
    
    This crash was detected by the new tests, which triggers PaymentRequest
    destructor during browser shutdown.
    
    Bug: 1121168
    Change-Id: I1e7ab94c3c6fac23ef5e3104beccc1ab1da2f3e5
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2375887
    Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
    Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#801738}
    5c38b304
payment_request.h 10.9 KB