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

Unified Diff: net/data/cache_tests/bad_rankings3/contents.txt

Issue 5112002: Disk cache: Add test files for another unit test. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/data/cache_tests/bad_rankings3/data_0 » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/data/cache_tests/bad_rankings3/contents.txt
===================================================================
--- net/data/cache_tests/bad_rankings3/contents.txt (revision 0)
+++ net/data/cache_tests/bad_rankings3/contents.txt (revision 0)
@@ -0,0 +1,92 @@
+Index file:
+version: 2.1
+entries: 3
+current id: 1
+last crash: 1
+head 0: 0x90000002
+tail 0: 0x90000002
+size 0: 0x1
+head 1: 0x90000001 <----
+tail 1: 0x90000000
+size 1: 0x2
+transaction: 0x0
+-------------------------
+
+Entry at 0xa0010002
+hash: 0x687d1422
+next entry: 0x0
+rankings: 0x90000000
+key length: 13
+key: "the first key"
+key addr: 0x0
+reuse count: 1
+----------
+
+Rankings at 0x90000000
+next: 0x90000000
+prev: 0x90000001
+entry: 0xa0010002
+dirty: 0
+----------
+
+Entry at 0xa0010003
+hash: 0x4a70620e
+next entry: 0x0
+rankings: 0x90000001
+key length: 14
+key: "the second key"
+key addr: 0x0
+reuse count: 0 <---- list 0
+----------
+
+Rankings at 0x90000001
+next: 0x90000000
+prev: 0x90000001 <----- head
+entry: 0xa0010003
+dirty: 1 <----- This was actually inserted on list 1
+----------
+
+Entry at 0xa0010004
+hash: 0x63909ecb
+next entry: 0x0
+rankings: 0x90000002
+key length: 14
+key: "some other key"
+key addr: 0x0
+reuse count: 0
+----------
+
+Rankings at 0x90000002
+next: 0x90000002
+prev: 0x90000002
+entry: 0xa0010004
+dirty: 0
+----------
+
+================================
+
+Generated with:
+
+ SetNewEviction();
+ SetMaxSize(20 * 1024 * 1024);
+ InitCache();
+ const char* kName1 = "the first key";
+ const char* kName2 = "the second key";
+ disk_cache::Entry* entry;
+ ASSERT_EQ(net::OK, CreateEntry(kName1, &entry));
+ entry->Close();
+ ASSERT_EQ(net::OK, CreateEntry(kName2, &entry));
+ entry->Close();
+ ASSERT_EQ(net::OK, CreateEntry("some other key", &entry));
+ entry->Close();
+
+ ASSERT_EQ(net::OK, OpenEntry(kName1, &entry));
+ entry->Close();
+
+ ASSERT_EQ(net::OK, OpenEntry(kName2, &entry));
+
+Set a breakpoint on that last line, and when the entry is moved from one list to another, crash the process:
+
+ rankings_->Remove(entry->rankings(), Rankings::NO_USE);
+ rankings_->Insert(entry->rankings(), false, Rankings::LOW_USE);
+ entry->entry()->Store(); <---- crash here
Property changes on: net\data\cache_tests\bad_rankings3\contents.txt
___________________________________________________________________
Added: svn:eol-style
+ native
« no previous file with comments | « no previous file | net/data/cache_tests/bad_rankings3/data_0 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698