• Mark Cogan's avatar
    [iOS] Regression tests for PDF snapshot crashes. · 3a54efae
    Mark Cogan authored
    This CL adds regression tests for some of the PDF snapshot bugs fixed in
    prior CLs (see http://crbug/981893). Specifically tests are added for:
    
    - Switching back and forth quickly between a complex PDF and a regular
      tab.
    
    - Switching back and forth quickly between two PDF tabs.
    
    - Opening a PDF and then entering the tab grid and waiting ~5 seconds.
    
    A known-crashing PDF (from www.irs.gov) is added to the test data for
    these tests.
    
    Since there's no good single component that "owns" these tests, this CL
    creates a ui/integration_tests directory.
    
    Since this test needs a way to locate the toolbar for swiping to change
    tabs, this CL adds a utility matcher for that.
    
    TEST=I verified that the crashes fixed before could be retriggered by at
    least one of these tests. The root cause of the crash was that WebKit
    was calling snapshotting callbacks more than once, and the implementation
    of the callback was a OnceCallback. The fix was to change this to a
    RepeatingCallback. I verified that these tests would have found this
    regression by CHECKing the second time the callback was called.
    
    Bug: 993395
    Change-Id: Iea130d4ed82017096ad3420161fb59a224d128d0
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1768707
    Commit-Queue: Mark Cogan <marq@chromium.org>
    Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#692039}
    3a54efae
chrome_matchers.mm 12.2 KB