Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Issue 2008323002: Add tests for the cache deletion in BrowsingDataRemover (Closed)

Created:
4 years, 6 months ago by msramek
Modified:
4 years, 6 months ago
Reviewers:
dmurph
CC:
chromium-reviews, gavinp+disk_chromium.org, kinuko+cache_chromium.org, markusheintz_, msramek+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -13 lines) Patch
M chrome/browser/browsing_data/browsing_data_remover.cc View 1 chunk +6 lines, -1 line 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover_browsertest.cc View 8 chunks +93 lines, -8 lines 0 comments Download
M components/browsing_data/conditional_cache_deletion_helper.cc View 1 1 chunk +8 lines, -3 lines 0 comments Download
M components/browsing_data/storage_partition_http_cache_data_remover.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 13 (5 generated)
msramek
Hi Dan, please have a look! Thanks, Martin
4 years, 6 months ago (2016-05-25 14:29:50 UTC) #3
dmurph
Awesome, lgtm!
4 years, 6 months ago (2016-05-25 19:04:59 UTC) #4
dmurph
On 2016/05/25 at 19:04:59, dmurph wrote: > Awesome, lgtm! Looks like you got some leaks ...
4 years, 6 months ago (2016-05-27 02:08:38 UTC) #5
msramek
Sorry for the delay with landing this. I didn't have time to investigate the memory ...
4 years, 6 months ago (2016-05-31 19:51:14 UTC) #7
dmurph
nice catch, lgtm
4 years, 6 months ago (2016-05-31 20:11:51 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2008323002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2008323002/60001
4 years, 6 months ago (2016-05-31 21:03:45 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:60001)
4 years, 6 months ago (2016-05-31 21:08:46 UTC) #11
commit-bot: I haz the power
4 years, 6 months ago (2016-05-31 21:09:54 UTC) #13
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/eeabde240e3f049dc8b0a2b353cf74e6f528d131
Cr-Commit-Position: refs/heads/master@{#396929}

Powered by Google App Engine
This is Rietveld 408576698