• Liquan (Max) Gu's avatar
    [PaymentHandler] Resolve test timeout by correcting PRUI onDismiss · 9bf4c080
    Liquan (Max) Gu authored
    Cause analysis:
    We are trying to enable two test suites for BottomSheet(BS)
    PaymentHandler (PH) UI - PaymentRequestServiceWorkerPaymentAppTest and
    PaymentHandlerChangePaymentMethodTest. Currently the two tests would
    fail (BS PH enabled) because they are both timeout on waiting for
    PaymentRequestUI#onDismiss() to be called. The reason why it's never
    invoked is because when mDialog.isShowing(), not only
    mDialog.dismiss() is bypassed (in DimmingDialog), but mDialog's dismiss
    listener callback is bypassed as well (in Android's Dialog.java).
    
    Why dimming dialog is not showing in BS PH UI is
    because of scrim. For CCT PH UI, the scrim is provided by PR UI; for
    BottomSheet PH UI, it's by BottomSheet. As a result, DimmingDialog (the
    scrim) is showing in CCT and not showing in BS PH UI.
    
    Before change:
    PaymentHandlerChangePaymentMethodTest and
    PaymentRequestServiceWorkerPaymentAppTest fails on some tests.
    
    After change:
    All tests are green.
    
    Change:
    * Replace DialogInterface.onDismissListener with
    DimmingDialog.onDismissListener.
    * Add onDismissListener invocation for DimmingDialog's dismissal.
    
    Bug: 1045088
    
    Change-Id: Iaedebfb1e9250eeb1974c63083c33cf8a89149df
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2047344
    Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
    Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#743142}
    9bf4c080
chrome_test_java_sources.gni 47.1 KB