Commit 71cfb089 authored by earthdok@chromium.org's avatar earthdok@chromium.org

Flush the SimpleBackendImpl's SWP in tests.

Fixes memory leaks.

BUG=278187
R=gavinp

Review URL: https://chromiumcodereview.appspot.com/22882009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220615 0039d316-1c4b-4281-b951-d872f2087c98
parent 82f84b91
...@@ -240,6 +240,8 @@ void DiskCacheTestWithCache::AddDelay() { ...@@ -240,6 +240,8 @@ void DiskCacheTestWithCache::AddDelay() {
} }
void DiskCacheTestWithCache::TearDown() { void DiskCacheTestWithCache::TearDown() {
base::RunLoop().RunUntilIdle();
disk_cache::SimpleBackendImpl::FlushWorkerPoolForTesting();
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
cache_.reset(); cache_.reset();
if (cache_thread_.IsRunning()) if (cache_thread_.IsRunning())
......
...@@ -568,4 +568,9 @@ void SimpleBackendImpl::CheckIterationReturnValue( ...@@ -568,4 +568,9 @@ void SimpleBackendImpl::CheckIterationReturnValue(
CallCompletionCallback(callback, error_code); CallCompletionCallback(callback, error_code);
} }
void SimpleBackendImpl::FlushWorkerPoolForTesting() {
if (g_sequenced_worker_pool)
g_sequenced_worker_pool->FlushForTesting();
}
} // namespace disk_cache } // namespace disk_cache
...@@ -64,6 +64,9 @@ class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend, ...@@ -64,6 +64,9 @@ class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend,
// operations to construct a new object. // operations to construct a new object.
void OnDeactivated(const SimpleEntryImpl* entry); void OnDeactivated(const SimpleEntryImpl* entry);
// Flush our SequencedWorkerPool.
static void FlushWorkerPoolForTesting();
// Backend: // Backend:
virtual net::CacheType GetCacheType() const OVERRIDE; virtual net::CacheType GetCacheType() const OVERRIDE;
virtual int32 GetEntryCount() const OVERRIDE; virtual int32 GetEntryCount() const OVERRIDE;
......
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