• Chase Phillips's avatar
    AppCache: Allow AppCacheUpdateJobTest to monitor multiple requests · d3517f13
    Chase Phillips authored
    Originally, the AppCacheUpdateJobTest was only concerned with testing
    that manifest fetches and the headers that were returned matched
    expectations.  That was because the update job tests weren't verifying
    anything about the fetch process for cached resources.
    
    Unfortunately, the 304 response handling for cached resources isn't
    correct which led to a series of bugs where any cached resource that
    gets a 304 response can go stale when it could instead have had its
    lifetime extended by the server.  This, coupled with a bug where
    the request and response times weren't saved at all led to a bunch
    of corrupt resources in AppCaches.
    
    This CL extends the interceptor in AppCacheUpdateJobTest so it can
    handle monitoring multiple resources, not just a single manifest
    resource.  A later CL will add a test which captures a full cache
    request and response cycle and monitors multiple resource fetches.
    
    Bug: 989611
    Change-Id: I486d11f5be187f76e2ab2bf2c0f931c3efa9d7f7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1989002
    Commit-Queue: Chase Phillips <cmp@chromium.org>
    Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
    Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#729861}
    d3517f13
appcache_update_job_unittest.cc 193 KB