| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/disk_cache/addr.h" | 5 #include "net/disk_cache/v2/addr.h" |
| 6 #include "net/disk_cache/block_files.h" | 6 #include "net/disk_cache/v2/block_files.h" |
| 7 #include "net/disk_cache/disk_format_base.h" | 7 #include "net/disk_cache/v2/disk_format_base.h" |
| 8 #include "net/disk_cache/v3/block_bitmaps.h" | 8 #include "net/disk_cache/v3/block_bitmaps.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 // Tests that we add and remove blocks correctly. | 11 // Tests that we add and remove blocks correctly. |
| 12 TEST(DiskCacheBlockBitmaps, V3AllocationMap) { | 12 TEST(DiskCacheBlockBitmaps, V3AllocationMap) { |
| 13 disk_cache::BlockBitmaps block_bitmaps; | 13 disk_cache::BlockBitmaps block_bitmaps; |
| 14 disk_cache::BlockFilesBitmaps bitmaps; | 14 disk_cache::BlockFilesBitmaps bitmaps; |
| 15 | 15 |
| 16 const int kNumHeaders = 10; | 16 const int kNumHeaders = 10; |
| 17 disk_cache::BlockFileHeader headers[kNumHeaders]; | 17 disk_cache::BlockFileHeader headers[kNumHeaders]; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 SCOPED_TRACE(i); | 61 SCOPED_TRACE(i); |
| 62 block_bitmaps.DeleteBlock(address[i]); | 62 block_bitmaps.DeleteBlock(address[i]); |
| 63 } | 63 } |
| 64 | 64 |
| 65 // The allocation map should be empty. | 65 // The allocation map should be empty. |
| 66 for (int i =0; i < 50; i++) { | 66 for (int i =0; i < 50; i++) { |
| 67 SCOPED_TRACE(i); | 67 SCOPED_TRACE(i); |
| 68 EXPECT_EQ(0, buffer[i]); | 68 EXPECT_EQ(0, buffer[i]); |
| 69 } | 69 } |
| 70 } | 70 } |
| OLD | NEW |