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

Side by Side Diff: net/disk_cache/blockfile/storage_block_unittest.cc

Issue 121643003: Reorganize net/disk_cache into backend specific directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & remediate Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "net/disk_cache/disk_format.h" 6 #include "net/disk_cache/blockfile/disk_format.h"
7 #include "net/disk_cache/storage_block.h" 7 #include "net/disk_cache/blockfile/storage_block-inl.h"
8 #include "net/disk_cache/storage_block-inl.h" 8 #include "net/disk_cache/blockfile/storage_block.h"
9 #include "net/disk_cache/disk_cache_test_base.h" 9 #include "net/disk_cache/disk_cache_test_base.h"
10 #include "net/disk_cache/disk_cache_test_util.h" 10 #include "net/disk_cache/disk_cache_test_util.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 typedef disk_cache::StorageBlock<disk_cache::EntryStore> CacheEntryBlock; 13 typedef disk_cache::StorageBlock<disk_cache::EntryStore> CacheEntryBlock;
14 14
15 TEST_F(DiskCacheTest, StorageBlock_LoadStore) { 15 TEST_F(DiskCacheTest, StorageBlock_LoadStore) {
16 base::FilePath filename = cache_path_.AppendASCII("a_test"); 16 base::FilePath filename = cache_path_.AppendASCII("a_test");
17 scoped_refptr<disk_cache::MappedFile> file(new disk_cache::MappedFile); 17 scoped_refptr<disk_cache::MappedFile> file(new disk_cache::MappedFile);
18 ASSERT_TRUE(CreateCacheTestFile(filename)); 18 ASSERT_TRUE(CreateCacheTestFile(filename));
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 EXPECT_TRUE(entry1->Load()); 63 EXPECT_TRUE(entry1->Load());
64 EXPECT_TRUE(0 == entry1->Data()->hash); 64 EXPECT_TRUE(0 == entry1->Data()->hash);
65 entry1->Data()->hash = 0x45687912; 65 entry1->Data()->hash = 0x45687912;
66 entry1->set_modified(); 66 entry1->set_modified();
67 delete entry1; 67 delete entry1;
68 68
69 CacheEntryBlock entry2(file.get(), disk_cache::Addr(0xa0010003)); 69 CacheEntryBlock entry2(file.get(), disk_cache::Addr(0xa0010003));
70 EXPECT_TRUE(entry2.Load()); 70 EXPECT_TRUE(entry2.Load());
71 EXPECT_TRUE(0x45687912 == entry2.Data()->hash); 71 EXPECT_TRUE(0x45687912 == entry2.Data()->hash);
72 } 72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698