• meacer's avatar
    Fix flaky CertificateReportingService browser tests. · ba3bd9c5
    meacer authored
    CertificateReportingService browser tests wait for the IO thread
    after sending a report or resetting the service. This doesn't seem
    reliable and the tests occasionally fail. A better approach is to:
    - For reports, wait for requests to be destroyed
    (CertificateReportingService unit test already does this).
    - For service resets, wait for a callback to be called.
    
    This CL does these: It removes WaitForIOThread calls from the browser
    test and replaces them with the above. It also refactors the following:
    - RequestObserver is shared between browser and unit tests.
    - NetworkDelegate is no longer used in the unit tests. RequestObserver is
    used instead.
    - All tests now expect no URL requests to remain during tear down.
    - The code to check expected reports is now shared.
    
    BUG=677560
    
    Review-Url: https://codereview.chromium.org/2605403002
    Cr-Commit-Position: refs/heads/master@{#442008}
    ba3bd9c5
certificate_reporting_service.cc 11.7 KB