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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/platform_thread.h" | 8 #include "base/platform_thread.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 disk_cache::Entry* entry; | 500 disk_cache::Entry* entry; |
501 void* iter = NULL; | 501 void* iter = NULL; |
502 int count = 0; | 502 int count = 0; |
503 Time last_modified[kNumEntries]; | 503 Time last_modified[kNumEntries]; |
504 Time last_used[kNumEntries]; | 504 Time last_used[kNumEntries]; |
505 while (cache_->OpenNextEntry(&iter, &entry)) { | 505 while (cache_->OpenNextEntry(&iter, &entry)) { |
506 ASSERT_TRUE(NULL != entry); | 506 ASSERT_TRUE(NULL != entry); |
507 if (count < kNumEntries) { | 507 if (count < kNumEntries) { |
508 last_modified[count] = entry->GetLastModified(); | 508 last_modified[count] = entry->GetLastModified(); |
509 last_used[count] = entry->GetLastUsed(); | 509 last_used[count] = entry->GetLastUsed(); |
| 510 EXPECT_TRUE(initial <= last_modified[count]); |
| 511 EXPECT_TRUE(final >= last_modified[count]); |
510 } | 512 } |
511 | 513 |
512 EXPECT_TRUE(initial <= last_modified[count]); | |
513 EXPECT_TRUE(final >= last_modified[count]); | |
514 entry->Close(); | 514 entry->Close(); |
515 count++; | 515 count++; |
516 }; | 516 }; |
517 EXPECT_EQ(kNumEntries, count); | 517 EXPECT_EQ(kNumEntries, count); |
518 | 518 |
519 iter = NULL; | 519 iter = NULL; |
520 count = 0; | 520 count = 0; |
521 // The previous enumeration should not have changed the timestamps. | 521 // The previous enumeration should not have changed the timestamps. |
522 while (cache_->OpenNextEntry(&iter, &entry)) { | 522 while (cache_->OpenNextEntry(&iter, &entry)) { |
523 ASSERT_TRUE(NULL != entry); | 523 ASSERT_TRUE(NULL != entry); |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 TEST_F(DiskCacheBackendTest, DoomAll) { | 977 TEST_F(DiskCacheBackendTest, DoomAll) { |
978 InitCache(); | 978 InitCache(); |
979 BackendDoomAll(); | 979 BackendDoomAll(); |
980 } | 980 } |
981 | 981 |
982 TEST_F(DiskCacheBackendTest, MemoryOnlyDoomAll) { | 982 TEST_F(DiskCacheBackendTest, MemoryOnlyDoomAll) { |
983 SetMemoryOnlyMode(); | 983 SetMemoryOnlyMode(); |
984 InitCache(); | 984 InitCache(); |
985 BackendDoomAll(); | 985 BackendDoomAll(); |
986 } | 986 } |
OLD | NEW |