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

Side by Side Diff: net/disk_cache/entry_unittest.cc

Issue 174592: Fix DiskCacheEntryTest.MemoryOnlyDoomSparseEntry (Closed)
Patch Set: cache only Created 11 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/disk_cache/mem_entry_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/platform_thread.h" 6 #include "base/platform_thread.h"
7 #include "base/timer.h" 7 #include "base/timer.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 } 1195 }
1196 EXPECT_EQ(0, cache_->GetEntryCount()); 1196 EXPECT_EQ(0, cache_->GetEntryCount());
1197 } 1197 }
1198 } 1198 }
1199 1199
1200 TEST_F(DiskCacheEntryTest, DoomSparseEntry) { 1200 TEST_F(DiskCacheEntryTest, DoomSparseEntry) {
1201 InitCache(); 1201 InitCache();
1202 DoomSparseEntry(); 1202 DoomSparseEntry();
1203 } 1203 }
1204 1204
1205 TEST_F(DiskCacheEntryTest, DISABLED_MemoryOnlyDoomSparseEntry) { 1205 TEST_F(DiskCacheEntryTest, MemoryOnlyDoomSparseEntry) {
1206 SetMemoryOnlyMode(); 1206 SetMemoryOnlyMode();
1207 InitCache(); 1207 InitCache();
1208 DoomSparseEntry(); 1208 DoomSparseEntry();
1209 } 1209 }
1210 1210
1211 void DiskCacheEntryTest::PartialSparseEntry() { 1211 void DiskCacheEntryTest::PartialSparseEntry() {
1212 std::string key("the first key"); 1212 std::string key("the first key");
1213 disk_cache::Entry* entry; 1213 disk_cache::Entry* entry;
1214 ASSERT_TRUE(cache_->CreateEntry(key, &entry)); 1214 ASSERT_TRUE(cache_->CreateEntry(key, &entry));
1215 1215
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 EXPECT_EQ(kSize, entry->WriteSparseData(k1Meg + 16384, buf1, kSize, NULL)); 1316 EXPECT_EQ(kSize, entry->WriteSparseData(k1Meg + 16384, buf1, kSize, NULL));
1317 EXPECT_EQ(0, entry->ReadSparseData(k1Meg + 8192, buf1, kSize, NULL)); 1317 EXPECT_EQ(0, entry->ReadSparseData(k1Meg + 8192, buf1, kSize, NULL));
1318 1318
1319 // We never touched this one. 1319 // We never touched this one.
1320 EXPECT_EQ(kSize, entry->ReadSparseData(8192, buf1, kSize, NULL)); 1320 EXPECT_EQ(kSize, entry->ReadSparseData(8192, buf1, kSize, NULL));
1321 entry->Close(); 1321 entry->Close();
1322 1322
1323 // We re-created one of the corrupt children. 1323 // We re-created one of the corrupt children.
1324 EXPECT_EQ(3, cache_->GetEntryCount()); 1324 EXPECT_EQ(3, cache_->GetEntryCount());
1325 } 1325 }
OLDNEW
« no previous file with comments | « no previous file | net/disk_cache/mem_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698