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

Unified Diff: net/disk_cache/backend_unittest.cc

Issue 22859060: Fix race condition for non-open/create operations happening after a doom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months 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/disk_cache/entry_unittest.cc » ('j') | net/disk_cache/entry_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/backend_unittest.cc
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index 7eeeee1fd83200c90b0dc1a2775f4654fd903a2f..c9738d007a4748a5595d9adab8cd4a99ebd5fc94 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -2682,15 +2682,15 @@ void DiskCacheBackendTest::BackendDoomAll() {
base::MessageLoop::current()->RunUntilIdle();
disk_cache::Entry *entry3, *entry4;
+ entry1->Close();
gavinp 2013/08/26 20:36:50 Why this?
Philippe 2013/08/27 11:33:30 Good question. I needed this (and the change below
gavinp 2013/08/27 15:48:02 I think this breaks the API; it's legal and should
Philippe 2013/08/27 16:11:21 Ok, thanks I will address that then :)
EXPECT_NE(net::OK, OpenEntry("third", &entry3));
ASSERT_EQ(net::OK, CreateEntry("third", &entry3));
+ entry2->Close();
ASSERT_EQ(net::OK, CreateEntry("fourth", &entry4));
EXPECT_EQ(net::OK, DoomAllEntries());
ASSERT_EQ(0, cache_->GetEntryCount());
- entry1->Close();
- entry2->Close();
entry3->Doom(); // The entry should be already doomed, but this must work.
entry3->Close();
entry4->Close();
« no previous file with comments | « no previous file | net/disk_cache/entry_unittest.cc » ('j') | net/disk_cache/entry_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698