OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |