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

Unified Diff: net/disk_cache/simple/simple_index_unittest.cc

Issue 17265007: Unlink corrupt SimpleCache index files immediately after load. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tryable Created 7 years, 6 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
Index: net/disk_cache/simple/simple_index_unittest.cc
diff --git a/net/disk_cache/simple/simple_index_unittest.cc b/net/disk_cache/simple/simple_index_unittest.cc
index abda20bd818c0dceb77879ae23af10e2c0f1c5d6..52875e24c90601a332163e9d7eaadad62ca562d4 100644
--- a/net/disk_cache/simple/simple_index_unittest.cc
+++ b/net/disk_cache/simple/simple_index_unittest.cc
@@ -40,10 +40,10 @@ class EntryMetadataTest : public testing::Test {
}
};
-class TestSimpleIndexFile : public SimpleIndexFile,
- public base::SupportsWeakPtr<TestSimpleIndexFile> {
+class MockSimpleIndexFile : public SimpleIndexFile,
+ public base::SupportsWeakPtr<MockSimpleIndexFile> {
public:
- TestSimpleIndexFile()
+ MockSimpleIndexFile()
: SimpleIndexFile(NULL, NULL, base::FilePath()),
get_index_entries_calls_(0),
doom_entry_set_calls_(0),
@@ -103,7 +103,7 @@ class TestSimpleIndexFile : public SimpleIndexFile,
class SimpleIndexTest : public testing::Test {
public:
virtual void SetUp() OVERRIDE {
- scoped_ptr<TestSimpleIndexFile> index_file(new TestSimpleIndexFile());
+ scoped_ptr<MockSimpleIndexFile> index_file(new MockSimpleIndexFile());
index_file_ = index_file->AsWeakPtr();
index_.reset(new SimpleIndex(NULL, base::FilePath(),
index_file.PassAs<SimpleIndexFile>()));
@@ -145,12 +145,12 @@ class SimpleIndexTest : public testing::Test {
// Non-const for timer manipulation.
SimpleIndex* index() { return index_.get(); }
- const TestSimpleIndexFile* index_file() const { return index_file_.get(); }
+ const MockSimpleIndexFile* index_file() const { return index_file_.get(); }
protected:
SimpleIndex::EntrySet index_file_return_map_;
scoped_ptr<SimpleIndex> index_;
- base::WeakPtr<TestSimpleIndexFile> index_file_;
+ base::WeakPtr<MockSimpleIndexFile> index_file_;
};
TEST_F(EntryMetadataTest, Basics) {

Powered by Google App Engine
This is Rietveld 408576698