summaryrefslogtreecommitdiffstats
path: root/net/data
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 23:36:08 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 23:36:08 +0000
commitac7446a69411c2fd95793ad58f36171188ae41ac (patch)
tree7f5254ab6ed4dc17ab2e30475eefad5ec4764cad /net/data
parent1f72efc682e07dbfbab2ffdf88e4ba44217e1a99 (diff)
downloadchromium_src-ac7446a69411c2fd95793ad58f36171188ae41ac.zip
chromium_src-ac7446a69411c2fd95793ad58f36171188ae41ac.tar.gz
chromium_src-ac7446a69411c2fd95793ad58f36171188ae41ac.tar.bz2
Disk cache: More files for unit tests.
BUG=62085 TEST=none TBR=gavinp@chromium.org Review URL: http://codereview.chromium.org/6519028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75202 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/data')
-rw-r--r--net/data/cache_tests/dirty_entry5/contents.txt166
-rw-r--r--net/data/cache_tests/dirty_entry5/data_0bin0 -> 45056 bytes
-rw-r--r--net/data/cache_tests/dirty_entry5/data_1bin0 -> 270336 bytes
-rw-r--r--net/data/cache_tests/dirty_entry5/data_2bin0 -> 8192 bytes
-rw-r--r--net/data/cache_tests/dirty_entry5/data_3bin0 -> 8192 bytes
-rw-r--r--net/data/cache_tests/dirty_entry5/indexbin0 -> 262512 bytes
6 files changed, 166 insertions, 0 deletions
diff --git a/net/data/cache_tests/dirty_entry5/contents.txt b/net/data/cache_tests/dirty_entry5/contents.txt
new file mode 100644
index 0000000..afa5c03
--- /dev/null
+++ b/net/data/cache_tests/dirty_entry5/contents.txt
@@ -0,0 +1,166 @@
+Index file:
+magic: c103cac3
+version: 2.0
+entries: 2 <---- there is an extra entry on the lru.
+total bytes: 47
+last file number: 0
+current id: 3
+table length: 65536
+last crash: 1
+experiment: 0
+head 0: 0x90000000
+tail 0: 0x90000001
+size 0: 0x0
+head 1: 0x0
+tail 1: 0x0
+size 1: 0x0
+head 2: 0x0
+tail 2: 0x0
+size 2: 0x0
+head 3: 0x0
+tail 3: 0x0
+size 3: 0x0
+head 4: 0x0
+tail 4: 0x0
+size 4: 0x0
+transaction: 0x0
+operation: 0
+operation list: 0
+-------------------------
+
+Block file: data_0
+magic: c104cac3
+version: 2.0
+file id: 0
+next file id: 0
+entry size: 36
+current entries: 2
+max entries: 1024
+updating: 0
+empty sz 1: 0
+empty sz 2: 1
+empty sz 3: 0
+empty sz 4: 255
+user 0: 0x0
+user 1: 0x0
+user 2: 0x0
+user 3: 0x0
+-------------------------
+
+Block file: data_1
+magic: c104cac3
+version: 2.0
+file id: 1
+next file id: 0
+entry size: 256
+current entries: 4
+max entries: 1024
+updating: 0
+empty sz 1: 0
+empty sz 2: 1
+empty sz 3: 0
+empty sz 4: 254
+user 0: 0x0
+user 1: 0x0
+user 2: 0x0
+user 3: 0x0
+-------------------------
+
+Block file: data_2
+magic: c104cac3
+version: 2.0
+file id: 2
+next file id: 0
+entry size: 1024
+current entries: 0
+max entries: 0
+updating: 0
+empty sz 1: 0
+empty sz 2: 0
+empty sz 3: 0
+empty sz 4: 0
+user 0: 0x0
+user 1: 0x0
+user 2: 0x0
+user 3: 0x0
+-------------------------
+
+Block file: data_3
+magic: c104cac3
+version: 2.0
+file id: 3
+next file id: 0
+entry size: 4096
+current entries: 0
+max entries: 0
+updating: 0
+empty sz 1: 0
+empty sz 2: 0
+empty sz 3: 0
+empty sz 4: 0
+user 0: 0x0
+user 1: 0x0
+user 2: 0x0
+user 3: 0x0
+-------------------------
+
+Entry at 0xa0010002
+hash: 0xc24ac438
+next entry: 0x0
+rankings: 0x90000000
+key length: 13
+key: "The first key"
+key addr: 0x0
+reuse count: 0
+refetch count: 0
+state: 0
+data size 0: 20
+data addr 0: 0xa0010005
+data size 1: 0
+data addr 1: 0x0
+data size 2: 0
+data addr 2: 0x0
+data size 3: 0
+data addr 3: 0x0
+----------
+
+Rankings at 0x90000000
+next: 0x90000001
+prev: 0x90000000
+entry: 0xa0010002
+dirty: 0
+pointer: 0x0
+
+================================
+
+Generated with: (see steps on the bug 69135)
+
+ SetMask(0x1); // 2-entry table.
+ SetMaxSize(0x3000); // 12 kB.
+ InitCache();
+
+ std::string key1("The first key");
+ std::string key2("The Second key");
+ std::string key3("The third key");
+ disk_cache::Entry* entry;
+
+ ASSERT_EQ(net::OK, CreateEntry(key1, &entry));
+ entry->Close();
+ ASSERT_EQ(net::OK, CreateEntry(key2, &entry));
+ entry->Close();
+ ASSERT_EQ(net::OK, CreateEntry(key3, &entry));
+ entry->Close();
+
+ const int kSize = 20;
+ ASSERT_EQ(net::OK, OpenEntry(key1, &entry));
+ scoped_refptr<net::IOBuffer> buf = new net::IOBuffer(kSize);
+ memset(buf->data(), 0, kSize);
+ EXPECT_EQ(kSize, WriteData(entry, 0, 0, buf, kSize, false));
+ entry->Close();
+
+ ASSERT_EQ(net::OK, OpenEntry(key2, &entry)); <--- 1st crash.
+ ASSERT_NE(net::OK, OpenEntry(key2, &entry)); <--- 2nd crash. *
+
+ ASSERT_EQ(net::OK, DoomEntry(key3));
+
+(*) and trick the code into deleting the dirty flag. \ No newline at end of file
diff --git a/net/data/cache_tests/dirty_entry5/data_0 b/net/data/cache_tests/dirty_entry5/data_0
new file mode 100644
index 0000000..5231b26
--- /dev/null
+++ b/net/data/cache_tests/dirty_entry5/data_0
Binary files differ
diff --git a/net/data/cache_tests/dirty_entry5/data_1 b/net/data/cache_tests/dirty_entry5/data_1
new file mode 100644
index 0000000..0cd5654
--- /dev/null
+++ b/net/data/cache_tests/dirty_entry5/data_1
Binary files differ
diff --git a/net/data/cache_tests/dirty_entry5/data_2 b/net/data/cache_tests/dirty_entry5/data_2
new file mode 100644
index 0000000..c7e2eb9
--- /dev/null
+++ b/net/data/cache_tests/dirty_entry5/data_2
Binary files differ
diff --git a/net/data/cache_tests/dirty_entry5/data_3 b/net/data/cache_tests/dirty_entry5/data_3
new file mode 100644
index 0000000..5eec973
--- /dev/null
+++ b/net/data/cache_tests/dirty_entry5/data_3
Binary files differ
diff --git a/net/data/cache_tests/dirty_entry5/index b/net/data/cache_tests/dirty_entry5/index
new file mode 100644
index 0000000..70110bc
--- /dev/null
+++ b/net/data/cache_tests/dirty_entry5/index
Binary files differ