Commit 943972ff authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

AppCache: Remove custom infrastructure from AppCacheResponseTest.

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}
parent 5deac0a9
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment