• rbpotter's avatar
    PDF Viewer edit mode: Fix race condition · 4cbd33ec
    rbpotter authored
    Fix a race condition where if the download button is clicked while a
    form field is still focused, the plugin may not have yet notified the
    UI that the document has edits. This results in the "Edited"/"Original"
    menu not appearing, and the original document being directly downloaded
    instead.
    
    Check before saving the original document if a form field is focused,
    and if so, wait for the form field focus to change, which gives the
    plugin time to send the edit status update.
    
    Bug: 1098082
    Change-Id: Ib11aa2ca9c06d06b9d05041272b070a674b316f7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2261188Reviewed-by: default avatardpapad <dpapad@chromium.org>
    Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#782114}
    4cbd33ec
test_util.js 4.72 KB