summaryrefslogtreecommitdiffstats
path: root/net/data/cache_tests
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-28 01:32:25 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-28 01:32:25 +0000
commitdc8b936deddb16343b09df857bbdd75f11f9408d (patch)
tree813e0f7a7d4cd466133e9742c84944f7655078e1 /net/data/cache_tests
parent266bc72a27ab755abfcad858d702c891ee2c9155 (diff)
downloadchromium_src-dc8b936deddb16343b09df857bbdd75f11f9408d.zip
chromium_src-dc8b936deddb16343b09df857bbdd75f11f9408d.tar.gz
chromium_src-dc8b936deddb16343b09df857bbdd75f11f9408d.tar.bz2
Disk cache: Reset mask_ when the disk cache is being restarted.
It is possible that the size for the index table is reduced when the cache is restarted (the available disk space could be lower than what it was when the cache was originally created). If that is the case, not resetting mask_ to 0 will prevent the mask to be set correctly for the new table size, resulting in a crash. BUG=12378 TEST=unittests Review URL: http://codereview.chromium.org/113930 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17052 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/data/cache_tests')
-rw-r--r--net/data/cache_tests/bad_rankings2/contents.txt66
-rw-r--r--net/data/cache_tests/bad_rankings2/data_0bin0 -> 45056 bytes
-rw-r--r--net/data/cache_tests/bad_rankings2/data_1bin0 -> 270336 bytes
-rw-r--r--net/data/cache_tests/bad_rankings2/data_2bin0 -> 8192 bytes
-rw-r--r--net/data/cache_tests/bad_rankings2/data_3bin0 -> 8192 bytes
-rw-r--r--net/data/cache_tests/bad_rankings2/indexbin0 -> 524656 bytes
6 files changed, 66 insertions, 0 deletions
diff --git a/net/data/cache_tests/bad_rankings2/contents.txt b/net/data/cache_tests/bad_rankings2/contents.txt
new file mode 100644
index 0000000..a949728
--- /dev/null
+++ b/net/data/cache_tests/bad_rankings2/contents.txt
@@ -0,0 +1,66 @@
+Index header:
+num_entries: 2
+num_bytes: 27
+this_id: 1
+table_len: 64k
+
+head: 0x90000001
+tail: 0x90000000
+
+Address: 0xa0010002
+Address: 0xa0010003
+
+-------------------------------
+
+entry:
+Address: 0xa0010002
+hash: 0x687d1422
+next: 0
+rankings_node: 0x90000000
+key_len: 13
+long_key: 0
+data_size: 0's
+data_addr: 0's
+key: "the first key"
+
+rankings:
+Address: 0x90000000
+next: 0x90000000
+prev: 0 <------ wrong
+contents: 0xa0010002
+dirty: 0
+pointer: 0
+
+-------------------------------
+
+entry:
+Address: 0xa0010003
+hash: 0x63909ecb
+next: 0
+rankings_node: 0x90000001
+key_len: 14
+long_key: 0
+data_size: 0's
+data_addr: 0's
+key: "some other key"
+
+rankings:
+Address: 0x90000001
+next: 0x90000000
+prev: 0x90000001
+contents: 0xa0010003
+dirty: 0
+pointer: 0
+
+================================
+
+Generated with:
+
+disk_cache::Entry *entry;
+ASSERT_TRUE(cache_->CreateEntry("the first key", &entry));
+entry->Close();
+
+ASSERT_TRUE(cache_->CreateEntry("some other key", &entry)); <---- Edit value*
+entry->Close();
+
+* Edit the value with the debugger before it is saved to disk. \ No newline at end of file
diff --git a/net/data/cache_tests/bad_rankings2/data_0 b/net/data/cache_tests/bad_rankings2/data_0
new file mode 100644
index 0000000..5b32215
--- /dev/null
+++ b/net/data/cache_tests/bad_rankings2/data_0
Binary files differ
diff --git a/net/data/cache_tests/bad_rankings2/data_1 b/net/data/cache_tests/bad_rankings2/data_1
new file mode 100644
index 0000000..7241f13
--- /dev/null
+++ b/net/data/cache_tests/bad_rankings2/data_1
Binary files differ
diff --git a/net/data/cache_tests/bad_rankings2/data_2 b/net/data/cache_tests/bad_rankings2/data_2
new file mode 100644
index 0000000..c7e2eb9
--- /dev/null
+++ b/net/data/cache_tests/bad_rankings2/data_2
Binary files differ
diff --git a/net/data/cache_tests/bad_rankings2/data_3 b/net/data/cache_tests/bad_rankings2/data_3
new file mode 100644
index 0000000..5eec973
--- /dev/null
+++ b/net/data/cache_tests/bad_rankings2/data_3
Binary files differ
diff --git a/net/data/cache_tests/bad_rankings2/index b/net/data/cache_tests/bad_rankings2/index
new file mode 100644
index 0000000..602dfba
--- /dev/null
+++ b/net/data/cache_tests/bad_rankings2/index
Binary files differ