Index: net/disk_cache/backend_unittest.cc |
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc |
index 275f1a96a3d34b4c688143c06fddcb249556baf8..edc34315e310520d3506696a4794716e98dccd71 100644 |
--- a/net/disk_cache/backend_unittest.cc |
+++ b/net/disk_cache/backend_unittest.cc |
@@ -2899,6 +2899,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)); |
@@ -2907,7 +2914,6 @@ TEST_F(DiskCacheBackendTest, SimpleCacheOpenMissingFile) { |
// Failing to open the entry should delete the rest of these files. |
ASSERT_EQ(net::ERR_FAILED, OpenEntry(key, &entry)); |
- |
pasko-google - do not use
2013/05/02 14:01:43
an empty line preceding the comment looked better
felipeg
2013/05/02 14:10:05
Done.
|
// Confirm the rest of the files are gone. |
for (int i = 1; i < disk_cache::kSimpleEntryFileCount; ++i) { |
base::FilePath |
@@ -2930,6 +2936,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)); |