• Victor Costan's avatar
    AppCache: Remove custom infrastructure from AppCacheResponseTest. · 943972ff
    Victor Costan authored
    This CL replaces the following pieces of custom infrastructure with
    standardized pieces.
    
    1. A custom callback pump consisting of ScheduleNextTask(), PushNextTask(),
       and TestFinishedUnwound() is replaced by base::RunLoop and
       base::TaskRunner::PostTask().
    
    2. A custom threading setup consisting of a base::test::TaskEnvironment,
       a base::Thread simulating the IO thread, a base::WaitableEvent, and
       TestFinished() is replaced by content::BrowserTaskEnvironment and
       base::RunLoop::QuitClosure().
    
    This CL also moves the following shared methods from the test area to
    the shared methods area.
    
    * WriteOneBlock
    * WriteOutBlocks
    * ReadInBlocks
    * ReadOneBlock
    * VerifyOneBlock
    
    Last, this CL moves OnReadInfoComplete() from the shared methods area to
    the area of the only test that uses it.
    
    The CL leaves the file's overall structure in place, to facilitate
    review by offering anchoring points for the diffing algorithm.
    
    The motivation for this refactoring is that the QuotaClient mojofication
    benefits from having this test use a content::BrowserTaskEnvironment.
    
    Bug: 1016065
    Change-Id: I10945be179fa705b4048011dfda27be3e696d4d7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2518726Reviewed-by: default avatarenne <enne@chromium.org>
    Commit-Queue: Victor Costan <pwnall@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#824116}
    943972ff
appcache_response_unittest.cc 30.8 KB