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

Unified Diff: net/disk_cache/backend_unittest.cc

Issue 13907009: Support optimistic Create and Write operations on the SimpleCache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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') | no next file with comments »
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 70e24ac5dade8bb32638d85a10aa099daccceb02..3908f409e2fb647660cb84bf7228e46d4d8e2c68 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -2900,6 +2900,13 @@ TEST_F(DiskCacheBackendTest, SimpleCacheOpenMissingFile) {
entry->Close();
entry = NULL;
+ // To make sure the file creation completed we need to call open again so that
+ // we block until it actually created the files.
+ ASSERT_EQ(net::OK, OpenEntry(key, &entry));
+ ASSERT_TRUE(entry != NULL);
+ entry->Close();
+ entry = NULL;
+
// Delete one of the files in the entry.
base::FilePath to_delete_file = cache_path_.AppendASCII(
disk_cache::simple_util::GetFilenameFromKeyAndIndex(key, 0));
@@ -2931,6 +2938,13 @@ TEST_F(DiskCacheBackendTest, SimpleCacheOpenBadFile) {
entry->Close();
entry = NULL;
+ // To make sure the file creation completed we need to call open again so that
+ // we block until it actually created the files.
+ ASSERT_EQ(net::OK, OpenEntry(key, &entry));
+ ASSERT_NE(null, entry);
+ entry->Close();
+ entry = NULL;
+
// Write an invalid header on stream 1.
base::FilePath entry_file1_path = cache_path_.AppendASCII(
disk_cache::simple_util::GetFilenameFromKeyAndIndex(key, 1));
« no previous file with comments | « no previous file | net/disk_cache/entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698