summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/backend_unittest.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 19:47:08 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 19:47:08 +0000
commitc4c32fd86f36a5d282424eb3a4876f0601f8f097 (patch)
tree580af26d6d69af57f7b1c63b9fbb97fc42ef1877 /net/disk_cache/backend_unittest.cc
parenta5624da1a85ae1e2785d8534018329e5a144e1fc (diff)
downloadchromium_src-c4c32fd86f36a5d282424eb3a4876f0601f8f097.zip
chromium_src-c4c32fd86f36a5d282424eb3a4876f0601f8f097.tar.gz
chromium_src-c4c32fd86f36a5d282424eb3a4876f0601f8f097.tar.bz2
Disk cache: Keep a map of all open entries.
We still have a few crashes when for some reason we believe an entry is not dirty and we follow the pointer stored by its rankings node only to crash while accessing the memory. I have no explanation to why the dirty id matches the current one (a page boundary issue maybe?), but having a map with all open entries solves the issue of having to follow pointers from disk. BUG=15596, b/1120346 TEST=unittests Review URL: http://codereview.chromium.org/149218 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20067 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/backend_unittest.cc')
-rw-r--r--net/disk_cache/backend_unittest.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index bd510c0..8364f5e 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -57,7 +57,7 @@ class DiskCacheBackendTest : public DiskCacheTestWithCache {
void BackendRecoverInsert();
void BackendRecoverRemove();
void BackendInvalidEntry2();
- void BackendNotMarkedButDirty();
+ void BackendNotMarkedButDirty(const std::wstring& name);
void BackendDoomAll();
void BackendDoomAll2();
void BackendInvalidRankings();
@@ -974,8 +974,8 @@ TEST_F(DiskCacheBackendTest, NewEvictionInvalidEntry2) {
}
// We want to be able to deal with abnormal dirty entries.
-void DiskCacheBackendTest::BackendNotMarkedButDirty() {
- ASSERT_TRUE(CopyTestCache(L"dirty_entry"));
+void DiskCacheBackendTest::BackendNotMarkedButDirty(const std::wstring& name) {
+ ASSERT_TRUE(CopyTestCache(name));
DisableFirstCleanup();
InitCache();
@@ -986,12 +986,21 @@ void DiskCacheBackendTest::BackendNotMarkedButDirty() {
}
TEST_F(DiskCacheBackendTest, NotMarkedButDirty) {
- BackendNotMarkedButDirty();
+ BackendNotMarkedButDirty(L"dirty_entry");
}
TEST_F(DiskCacheBackendTest, NewEvictionNotMarkedButDirty) {
SetNewEviction();
- BackendNotMarkedButDirty();
+ BackendNotMarkedButDirty(L"dirty_entry");
+}
+
+TEST_F(DiskCacheBackendTest, NotMarkedButDirty2) {
+ BackendNotMarkedButDirty(L"dirty_entry2");
+}
+
+TEST_F(DiskCacheBackendTest, NewEvictionNotMarkedButDirty2) {
+ SetNewEviction();
+ BackendNotMarkedButDirty(L"dirty_entry2");
}
// We want to be able to deal with messed up entries on disk.