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

Unified Diff: net/disk_cache/flash/storage_unittest.cc

Issue 14265009: FlashCache refactorings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More refactorings. 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 | « net/disk_cache/flash/segment_unittest.cc ('k') | net/net.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/flash/storage_unittest.cc
diff --git a/net/disk_cache/flash/storage_unittest.cc b/net/disk_cache/flash/storage_unittest.cc
index ca0e56c175b199b4611b5af217b1de93bf012c4f..e8a1e3f18c8f125dc8062d75d6fe29d6b3585453 100644
--- a/net/disk_cache/flash/storage_unittest.cc
+++ b/net/disk_cache/flash/storage_unittest.cc
@@ -14,11 +14,13 @@ namespace {
const int32 kSizes[] = {512, 1024, 4096, 133, 1333, 13333};
const int32 kOffsets[] = {0, 1, 3333, 125, 12443, 4431};
-const int32 kStorageSize = 16 * 1024 * 1024;
} // namespace
TEST_F(FlashCacheTest, StorageReadWrite) {
+ disk_cache::Storage storage(path_, kStorageSize);
+ EXPECT_TRUE(storage.Init());
+
for (size_t i = 0; i < arraysize(kOffsets); ++i) {
int32 size = kSizes[i];
int32 offset = kOffsets[i];
@@ -28,10 +30,10 @@ TEST_F(FlashCacheTest, StorageReadWrite) {
CacheTestFillBuffer(write_buffer->data(), size, false);
- bool rv = storage_->Write(write_buffer->data(), size, offset);
+ bool rv = storage.Write(write_buffer->data(), size, offset);
EXPECT_TRUE(rv);
- rv = storage_->Read(read_buffer->data(), size, offset);
+ rv = storage.Read(read_buffer->data(), size, offset);
EXPECT_TRUE(rv);
EXPECT_EQ(0, memcmp(read_buffer->data(), write_buffer->data(), size));
« no previous file with comments | « net/disk_cache/flash/segment_unittest.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698