diff options
Diffstat (limited to 'net/disk_cache/backend_impl.cc')
-rw-r--r-- | net/disk_cache/backend_impl.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 790b618..7810a97 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -1037,7 +1037,10 @@ void BackendImpl::RestartCache() { init_ = false; restarted_ = true; int64 errors = stats_.GetCounter(Stats::FATAL_ERROR); - if (Init()) + + // Don't call Init() if directed by the unit test: we are simulating a failure + // trying to re-enable the cache. + if (!unit_test_ && Init()) stats_.SetCounter(Stats::FATAL_ERROR, errors + 1); } |