DescriptionAdd tests for the cache deletion in BrowsingDataRemover
The cache deletion was previously not tested in BrowsingDataRemover,
presumably because the helper class StoragePartitionHttpCacheDataRemover
instantiates a number of services that are difficult / not possible to
mock in the unittest.
Therefore, we will test this in the browsertest. The test added in this
CL only verifies two things:
1. That the cache deletion completes successfuly without crashing.
2. That the size of the cache decreases after deletion.
Whether the correct cache entries would be deleted is already tested
in the browsertest of ConditionalCacheDeletionHelper, which is the helper
class used by BrowsingDataRemover for partial cache deletion.
The added test uncovers two bugs in the conditional cache deletion (which
is currently not live) and fixes them.
1. Missing return value assignment in StoragePartitionHttpCacheDataRemover.
2. It is not possible to partially clear cookies for origin, and therefore
the creation of CookieMatcherFunction from an OriginFilterBuilder DCHECKs.
However, it should be possible to delete cache for an origin. When doing
so, we unnecessarily try to also instantiate CookieMatcherFunction, which
hits the mentioned DCHECK.
Finally, we replace URLRequestMockHTTPJob with an EmbeddedTestServer in the
browsertest. This is because to populate the cache, we need to make an actual
resource fetch.
BUG=113967
Committed: https://crrev.com/eeabde240e3f049dc8b0a2b353cf74e6f528d131
Cr-Commit-Position: refs/heads/master@{#396929}
Patch Set 1 : #Patch Set 2 : Fix memory leak #
Messages
Total messages: 13 (5 generated)
|