| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "net/disk_cache/block_files.h" | 6 #include "net/disk_cache/block_files.h" |
| 7 #include "net/disk_cache/disk_cache.h" | 7 #include "net/disk_cache/disk_cache.h" |
| 8 #include "net/disk_cache/disk_cache_test_base.h" | 8 #include "net/disk_cache/disk_cache_test_base.h" |
| 9 #include "net/disk_cache/disk_cache_test_util.h" | 9 #include "net/disk_cache/disk_cache_test_util.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 using base::Time; |
| 13 |
| 12 TEST_F(DiskCacheTest, BlockFiles_Grow) { | 14 TEST_F(DiskCacheTest, BlockFiles_Grow) { |
| 13 std::wstring path = GetCachePath(); | 15 std::wstring path = GetCachePath(); |
| 14 ASSERT_TRUE(DeleteCache(path.c_str())); | 16 ASSERT_TRUE(DeleteCache(path.c_str())); |
| 15 ASSERT_TRUE(file_util::CreateDirectory(path)); | 17 ASSERT_TRUE(file_util::CreateDirectory(path)); |
| 16 | 18 |
| 17 disk_cache::BlockFiles files(path); | 19 disk_cache::BlockFiles files(path); |
| 18 ASSERT_TRUE(files.Init(true)); | 20 ASSERT_TRUE(files.Init(true)); |
| 19 | 21 |
| 20 // Fill up the 32-byte block file (use three files). | 22 // Fill up the 32-byte block file (use three files). |
| 21 for (int i = 0; i < 35000; i++) { | 23 for (int i = 0; i < 35000; i++) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 ASSERT_TRUE(NULL != header); | 96 ASSERT_TRUE(NULL != header); |
| 95 | 97 |
| 96 ASSERT_EQ(0, header->updating); | 98 ASSERT_EQ(0, header->updating); |
| 97 | 99 |
| 98 EXPECT_EQ(max_entries, header->max_entries); | 100 EXPECT_EQ(max_entries, header->max_entries); |
| 99 EXPECT_EQ(empty_1, header->empty[0]); | 101 EXPECT_EQ(empty_1, header->empty[0]); |
| 100 EXPECT_EQ(empty_2, header->empty[1]); | 102 EXPECT_EQ(empty_2, header->empty[1]); |
| 101 EXPECT_EQ(empty_3, header->empty[2]); | 103 EXPECT_EQ(empty_3, header->empty[2]); |
| 102 EXPECT_EQ(empty_4, header->empty[3]); | 104 EXPECT_EQ(empty_4, header->empty[3]); |
| 103 } | 105 } |
| OLD | NEW |