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

Side by Side Diff: net/disk_cache/backend_unittest.cc

Issue 691803003: Do not DCHECK on SimpleCache deletion-while-closing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lint Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_index_file.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/port.h" 8 #include "base/port.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 3463 matching lines...) Expand 10 before | Expand all | Expand 10 after
3474 3474
3475 scoped_ptr<TestIterator> iter = CreateIterator(); 3475 scoped_ptr<TestIterator> iter = CreateIterator();
3476 disk_cache::Entry* entry = NULL; 3476 disk_cache::Entry* entry = NULL;
3477 ASSERT_EQ(net::OK, iter->OpenNextEntry(&entry)); 3477 ASSERT_EQ(net::OK, iter->OpenNextEntry(&entry));
3478 EXPECT_TRUE(entry); 3478 EXPECT_TRUE(entry);
3479 disk_cache::ScopedEntryPtr entry_closer(entry); 3479 disk_cache::ScopedEntryPtr entry_closer(entry);
3480 3480
3481 cache_.reset(); 3481 cache_.reset();
3482 // This test passes if we don't leak memory. 3482 // This test passes if we don't leak memory.
3483 } 3483 }
3484
3485 // Tests that a SimpleCache doesn't crash when files are deleted very quickly
3486 // after closing.
3487 // NOTE: IF THIS TEST IS FLAKY THEN IT IS FAILING. See https://crbug.com/416940
3488 TEST_F(DiskCacheBackendTest, SimpleCacheDeleteQuickly) {
3489 SetSimpleCacheMode();
3490 for (int i = 0; i < 100; ++i) {
3491 InitCache();
3492 cache_.reset();
3493 EXPECT_TRUE(CleanupCacheDir());
3494 }
3495 }
OLDNEW
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_index_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698