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

Unified Diff: net/disk_cache/flash/flash_entry_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/flash_cache_test_base.cc ('k') | net/disk_cache/flash/log_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/flash/flash_entry_unittest.cc
diff --git a/net/disk_cache/flash/flash_entry_unittest.cc b/net/disk_cache/flash/flash_entry_unittest.cc
deleted file mode 100644
index ea6eaaac1ef4678b768542505076cfad6b01d326..0000000000000000000000000000000000000000
--- a/net/disk_cache/flash/flash_entry_unittest.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/memory/ref_counted.h"
-#include "base/string_util.h"
-#include "base/threading/thread.h"
-#include "base/threading/thread_restrictions.h"
-#include "net/base/io_buffer.h"
-#include "net/base/net_errors.h"
-#include "net/disk_cache/disk_cache_test_util.h"
-#include "net/disk_cache/flash/flash_cache_test_base.h"
-#include "net/disk_cache/flash/flash_entry_impl.h"
-#include "net/disk_cache/flash/format.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using net::CompletionCallback;
-
-TEST_F(FlashCacheTest, FlashEntryCreate) {
- base::Thread cache_thread("CacheThread");
- ASSERT_TRUE(cache_thread.StartWithOptions(
- base::Thread::Options(MessageLoop::TYPE_IO, 0)));
-
- const std::string key = "foo.com";
- disk_cache::FlashEntryImpl* entry =
- new disk_cache::FlashEntryImpl(key,
- log_store_.get(),
- cache_thread.message_loop_proxy());
- entry->AddRef();
- EXPECT_EQ(net::OK, entry->Init(CompletionCallback()));
- EXPECT_EQ(key, entry->GetKey());
- EXPECT_EQ(0, entry->GetDataSize(0));
- EXPECT_EQ(0, entry->GetDataSize(1));
- EXPECT_EQ(0, entry->GetDataSize(2));
-
- const int kSize1 = 100;
- scoped_refptr<net::IOBuffer> buffer1(new net::IOBuffer(kSize1));
- CacheTestFillBuffer(buffer1->data(), kSize1, false);
- EXPECT_EQ(0, entry->ReadData(0, 0, buffer1, kSize1, CompletionCallback()));
- base::strlcpy(buffer1->data(), "the data", kSize1);
- EXPECT_EQ(kSize1, entry->WriteData(0, 0, buffer1, kSize1,
- CompletionCallback(), false));
- memset(buffer1->data(), 0, kSize1);
- EXPECT_EQ(kSize1, entry->ReadData(0, 0, buffer1, kSize1,
- CompletionCallback()));
- EXPECT_STREQ("the data", buffer1->data());
- entry->Close();
-}
« no previous file with comments | « net/disk_cache/flash/flash_cache_test_base.cc ('k') | net/disk_cache/flash/log_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698