OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/logging.h" | 6 #include "base/logging.h" |
7 #include "net/disk_cache/addr.h" | 7 #include "net/disk_cache/v2/addr.h" |
8 #include "net/disk_cache/v3/disk_format_v3.h" | 8 #include "net/disk_cache/v3/disk_format_v3.h" |
9 #include "net/disk_cache/v3/index_table.h" | 9 #include "net/disk_cache/v3/index_table.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 using disk_cache::EntryCell; | 12 using disk_cache::EntryCell; |
13 using disk_cache::IndexCell; | 13 using disk_cache::IndexCell; |
14 using disk_cache::IndexTable; | 14 using disk_cache::IndexTable; |
15 using disk_cache::IndexTableInitData; | 15 using disk_cache::IndexTableInitData; |
16 | 16 |
17 namespace { | 17 namespace { |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 | 697 |
698 uint32 hash = 0; | 698 uint32 hash = 0; |
699 disk_cache::Addr addr(disk_cache::BLOCK_ENTRIES, 1, 5, 6); | 699 disk_cache::Addr addr(disk_cache::BLOCK_ENTRIES, 1, 5, 6); |
700 EntryCell entry = index.CreateEntryCell(hash, addr); | 700 EntryCell entry = index.CreateEntryCell(hash, addr); |
701 EXPECT_TRUE(entry.IsValid()); | 701 EXPECT_TRUE(entry.IsValid()); |
702 | 702 |
703 index.OnBackupTimer(); | 703 index.OnBackupTimer(); |
704 int expected = (1024 + 512) / 8 + sizeof(disk_cache::IndexHeaderV3); | 704 int expected = (1024 + 512) / 8 + sizeof(disk_cache::IndexHeaderV3); |
705 EXPECT_EQ(expected, backend.buffer_len()); | 705 EXPECT_EQ(expected, backend.buffer_len()); |
706 } | 706 } |
OLD | NEW |