OLD | NEW |
1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2010 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 "base/thread.h" |
10 #include "net/base/io_buffer.h" | 11 #include "net/base/io_buffer.h" |
11 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
12 #include "net/base/test_completion_callback.h" | 13 #include "net/base/test_completion_callback.h" |
13 #include "net/disk_cache/backend_impl.h" | 14 #include "net/disk_cache/backend_impl.h" |
14 #include "net/disk_cache/disk_cache_test_base.h" | 15 #include "net/disk_cache/disk_cache_test_base.h" |
15 #include "net/disk_cache/disk_cache_test_util.h" | 16 #include "net/disk_cache/disk_cache_test_util.h" |
16 #include "net/disk_cache/histogram_macros.h" | 17 #include "net/disk_cache/histogram_macros.h" |
17 #include "net/disk_cache/mapped_file.h" | 18 #include "net/disk_cache/mapped_file.h" |
18 #include "net/disk_cache/mem_backend_impl.h" | 19 #include "net/disk_cache/mem_backend_impl.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 ASSERT_EQ(net::OK, CreateEntry("key", &entry)); | 247 ASSERT_EQ(net::OK, CreateEntry("key", &entry)); |
247 ASSERT_EQ(0, entry->WriteData(0, 20000, buffer1, 0, NULL, false)); | 248 ASSERT_EQ(0, entry->WriteData(0, 20000, buffer1, 0, NULL, false)); |
248 entry->Close(); | 249 entry->Close(); |
249 | 250 |
250 // And verify that the first file is still there. | 251 // And verify that the first file is still there. |
251 scoped_refptr<net::IOBuffer> buffer2 = new net::IOBuffer(kSize); | 252 scoped_refptr<net::IOBuffer> buffer2 = new net::IOBuffer(kSize); |
252 ASSERT_EQ(kSize, file_util::ReadFile(filename, buffer2->data(), kSize)); | 253 ASSERT_EQ(kSize, file_util::ReadFile(filename, buffer2->data(), kSize)); |
253 EXPECT_EQ(0, memcmp(buffer1->data(), buffer2->data(), kSize)); | 254 EXPECT_EQ(0, memcmp(buffer1->data(), buffer2->data(), kSize)); |
254 } | 255 } |
255 | 256 |
256 // Tests that we deal with file-level pending operations at destruction time. | |
257 TEST_F(DiskCacheTest, ShutdownWithPendingIO) { | 257 TEST_F(DiskCacheTest, ShutdownWithPendingIO) { |
258 TestCompletionCallback cb; | 258 TestCompletionCallback callback; |
259 | 259 |
260 { | 260 { |
261 FilePath path = GetCacheFilePath(); | 261 FilePath path = GetCacheFilePath(); |
262 ASSERT_TRUE(DeleteCache(path)); | 262 ASSERT_TRUE(DeleteCache(path)); |
263 base::Thread cache_thread("CacheThread"); | 263 base::Thread cache_thread("CacheThread"); |
264 ASSERT_TRUE(cache_thread.StartWithOptions( | 264 ASSERT_TRUE(cache_thread.StartWithOptions( |
265 base::Thread::Options(MessageLoop::TYPE_IO, 0))); | 265 base::Thread::Options(MessageLoop::TYPE_IO, 0))); |
266 | 266 |
267 disk_cache::Backend* cache; | 267 disk_cache::Backend* cache; |
268 int rv = disk_cache::BackendImpl::CreateBackend( | 268 int rv = disk_cache::BackendImpl::CreateBackend( |
269 path, false, 0, net::DISK_CACHE, disk_cache::kNoRandom, | 269 path, false, 0, net::DISK_CACHE, disk_cache::kNoRandom, |
270 base::MessageLoopProxy::CreateForCurrentThread(), &cache, &cb); | 270 cache_thread.message_loop_proxy(), &cache, &callback); |
271 ASSERT_EQ(net::OK, cb.GetResult(rv)); | 271 ASSERT_EQ(net::OK, callback.GetResult(rv)); |
272 | 272 |
273 disk_cache::EntryImpl* entry; | 273 disk_cache::Entry* entry; |
274 rv = cache->CreateEntry("some key", | 274 rv = cache->CreateEntry("some key", &entry, &callback); |
275 reinterpret_cast<disk_cache::Entry**>(&entry), &cb); | 275 ASSERT_EQ(net::OK, callback.GetResult(rv)); |
276 ASSERT_EQ(net::OK, cb.GetResult(rv)); | |
277 | 276 |
278 const int kSize = 25000; | 277 const int kSize = 25000; |
279 scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(kSize); | 278 scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(kSize); |
280 CacheTestFillBuffer(buffer->data(), kSize, false); | 279 CacheTestFillBuffer(buffer->data(), kSize, false); |
281 | 280 |
282 for (int i = 0; i < 10 * 1024 * 1024; i += 64 * 1024) { | 281 for (int i = 0; i < 10 * 1024 * 1024; i += 64 * 1024) { |
283 // We are using the current thread as the cache thread because we want to | 282 int rv = entry->WriteData(0, i, buffer, kSize, &callback, false); |
284 // be able to call directly this method to make sure that the OS (instead | |
285 // of us switching thread) is returning IO pending. | |
286 rv = entry->WriteDataImpl(0, i, buffer, kSize, &cb, false); | |
287 if (rv == net::ERR_IO_PENDING) | 283 if (rv == net::ERR_IO_PENDING) |
288 break; | 284 break; |
289 EXPECT_EQ(kSize, rv); | 285 EXPECT_EQ(kSize, rv); |
290 } | 286 } |
291 | 287 |
292 // Don't call Close() to avoid going through the queue or we'll deadlock | 288 entry->Close(); |
293 // waiting for the operation to finish. | |
294 entry->Release(); | |
295 | 289 |
296 // The cache destructor will see one pending operation here. | 290 // The cache destructor will see one pending operation here. |
297 delete cache; | 291 delete cache; |
298 | |
299 if (rv == net::ERR_IO_PENDING) { | |
300 EXPECT_TRUE(cb.have_result()); | |
301 } | |
302 } | |
303 | |
304 MessageLoop::current()->RunAllPending(); | |
305 } | |
306 | |
307 // Tests that we deal with background-thread pending operations. | |
308 TEST_F(DiskCacheTest, ShutdownWithPendingIO2) { | |
309 TestCompletionCallback cb; | |
310 | |
311 { | |
312 FilePath path = GetCacheFilePath(); | |
313 ASSERT_TRUE(DeleteCache(path)); | |
314 base::Thread cache_thread("CacheThread"); | |
315 ASSERT_TRUE(cache_thread.StartWithOptions( | |
316 base::Thread::Options(MessageLoop::TYPE_IO, 0))); | |
317 | |
318 disk_cache::Backend* cache; | |
319 int rv = disk_cache::BackendImpl::CreateBackend( | |
320 path, false, 0, net::DISK_CACHE, disk_cache::kNoRandom, | |
321 cache_thread.message_loop_proxy(), &cache, &cb); | |
322 ASSERT_EQ(net::OK, cb.GetResult(rv)); | |
323 | |
324 disk_cache::Entry* entry; | |
325 rv = cache->CreateEntry("some key", &entry, &cb); | |
326 ASSERT_EQ(net::OK, cb.GetResult(rv)); | |
327 | |
328 const int kSize = 25000; | |
329 scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(kSize); | |
330 CacheTestFillBuffer(buffer->data(), kSize, false); | |
331 | |
332 rv = entry->WriteData(0, 0, buffer, kSize, &cb, false); | |
333 EXPECT_EQ(net::ERR_IO_PENDING, rv); | |
334 | |
335 entry->Close(); | |
336 | |
337 // The cache destructor will see two pending operations here. | |
338 delete cache; | |
339 } | 292 } |
340 | 293 |
341 MessageLoop::current()->RunAllPending(); | 294 MessageLoop::current()->RunAllPending(); |
342 } | 295 } |
343 | 296 |
344 TEST_F(DiskCacheTest, TruncatedIndex) { | 297 TEST_F(DiskCacheTest, TruncatedIndex) { |
345 FilePath path = GetCacheFilePath(); | 298 FilePath path = GetCacheFilePath(); |
346 ASSERT_TRUE(DeleteCache(path)); | 299 ASSERT_TRUE(DeleteCache(path)); |
347 FilePath index = path.AppendASCII("index"); | 300 FilePath index = path.AppendASCII("index"); |
348 ASSERT_EQ(5, file_util::WriteFile(index, "hello", 5)); | 301 ASSERT_EQ(5, file_util::WriteFile(index, "hello", 5)); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } | 395 } |
443 | 396 |
444 for (int i = 0; i < 100; i++) { | 397 for (int i = 0; i < 100; i++) { |
445 disk_cache::Entry* entry; | 398 disk_cache::Entry* entry; |
446 ASSERT_EQ(net::OK, OpenEntry(entries[i]->GetKey(), &entry)); | 399 ASSERT_EQ(net::OK, OpenEntry(entries[i]->GetKey(), &entry)); |
447 EXPECT_TRUE(entry == entries[i]); | 400 EXPECT_TRUE(entry == entries[i]); |
448 entry->Close(); | 401 entry->Close(); |
449 entries[i]->Doom(); | 402 entries[i]->Doom(); |
450 entries[i]->Close(); | 403 entries[i]->Close(); |
451 } | 404 } |
452 FlushQueueForTest(); | |
453 EXPECT_EQ(0, cache_->GetEntryCount()); | 405 EXPECT_EQ(0, cache_->GetEntryCount()); |
454 } | 406 } |
455 | 407 |
456 TEST_F(DiskCacheBackendTest, Load) { | 408 TEST_F(DiskCacheBackendTest, Load) { |
457 // Work with a tiny index table (16 entries) | 409 // Work with a tiny index table (16 entries) |
458 SetMask(0xf); | 410 SetMask(0xf); |
459 SetMaxSize(0x100000); | 411 SetMaxSize(0x100000); |
460 BackendLoad(); | 412 BackendLoad(); |
461 } | 413 } |
462 | 414 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 | 618 |
667 // Simulate a crash. | 619 // Simulate a crash. |
668 SimulateCrash(); | 620 SimulateCrash(); |
669 | 621 |
670 ASSERT_EQ(net::OK, CreateEntry(second, &entry)); | 622 ASSERT_EQ(net::OK, CreateEntry(second, &entry)); |
671 EXPECT_EQ(kSize, entry->WriteData(0, 0, buffer, kSize, NULL, false)); | 623 EXPECT_EQ(kSize, entry->WriteData(0, 0, buffer, kSize, NULL, false)); |
672 | 624 |
673 EXPECT_EQ(2, cache_->GetEntryCount()); | 625 EXPECT_EQ(2, cache_->GetEntryCount()); |
674 SetMaxSize(kSize); | 626 SetMaxSize(kSize); |
675 entry->Close(); // Trim the cache. | 627 entry->Close(); // Trim the cache. |
676 FlushQueueForTest(); | |
677 | 628 |
678 // If we evicted the entry in less than 20mS, we have one entry in the cache; | 629 // If we evicted the entry in less than 20mS, we have one entry in the cache; |
679 // if it took more than that, we posted a task and we'll delete the second | 630 // if it took more than that, we posted a task and we'll delete the second |
680 // entry too. | 631 // entry too. |
681 MessageLoop::current()->RunAllPending(); | 632 MessageLoop::current()->RunAllPending(); |
682 EXPECT_GE(1, cache_->GetEntryCount()); | 633 EXPECT_GE(1, cache_->GetEntryCount()); |
683 EXPECT_NE(net::OK, OpenEntry(first, &entry)); | 634 EXPECT_NE(net::OK, OpenEntry(first, &entry)); |
684 } | 635 } |
685 | 636 |
686 // We'll be leaking memory from this test. | 637 // We'll be leaking memory from this test. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 EXPECT_EQ(33, cache_->GetEntryCount()); | 678 EXPECT_EQ(33, cache_->GetEntryCount()); |
728 SetMaxSize(kSize); | 679 SetMaxSize(kSize); |
729 | 680 |
730 // For the new eviction code, all corrupt entries are on the second list so | 681 // For the new eviction code, all corrupt entries are on the second list so |
731 // they are not going away that easy. | 682 // they are not going away that easy. |
732 if (new_eviction_) { | 683 if (new_eviction_) { |
733 EXPECT_EQ(net::OK, DoomAllEntries()); | 684 EXPECT_EQ(net::OK, DoomAllEntries()); |
734 } | 685 } |
735 | 686 |
736 entry->Close(); // Trim the cache. | 687 entry->Close(); // Trim the cache. |
737 FlushQueueForTest(); | |
738 | 688 |
739 // We may abort the eviction before cleaning up everything. | 689 // We may abort the eviction before cleaning up everything. |
740 MessageLoop::current()->RunAllPending(); | 690 MessageLoop::current()->RunAllPending(); |
741 EXPECT_GE(30, cache_->GetEntryCount()); | 691 EXPECT_GE(30, cache_->GetEntryCount()); |
742 } | 692 } |
743 | 693 |
744 // We'll be leaking memory from this test. | 694 // We'll be leaking memory from this test. |
745 TEST_F(DiskCacheBackendTest, TrimInvalidEntry2) { | 695 TEST_F(DiskCacheBackendTest, TrimInvalidEntry2) { |
746 BackendTrimInvalidEntry2(); | 696 BackendTrimInvalidEntry2(); |
747 } | 697 } |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 | 1252 |
1303 // If the LRU is corrupt, we delete the cache. | 1253 // If the LRU is corrupt, we delete the cache. |
1304 void DiskCacheBackendTest::BackendInvalidRankings() { | 1254 void DiskCacheBackendTest::BackendInvalidRankings() { |
1305 disk_cache::Entry* entry; | 1255 disk_cache::Entry* entry; |
1306 void* iter = NULL; | 1256 void* iter = NULL; |
1307 ASSERT_EQ(net::OK, OpenNextEntry(&iter, &entry)); | 1257 ASSERT_EQ(net::OK, OpenNextEntry(&iter, &entry)); |
1308 entry->Close(); | 1258 entry->Close(); |
1309 EXPECT_EQ(2, cache_->GetEntryCount()); | 1259 EXPECT_EQ(2, cache_->GetEntryCount()); |
1310 | 1260 |
1311 EXPECT_NE(net::OK, OpenNextEntry(&iter, &entry)); | 1261 EXPECT_NE(net::OK, OpenNextEntry(&iter, &entry)); |
1312 FlushQueueForTest(); // Allow the restart to finish. | 1262 MessageLoop::current()->RunAllPending(); |
1313 EXPECT_EQ(0, cache_->GetEntryCount()); | 1263 EXPECT_EQ(0, cache_->GetEntryCount()); |
1314 } | 1264 } |
1315 | 1265 |
1316 TEST_F(DiskCacheBackendTest, InvalidRankingsSuccess) { | 1266 TEST_F(DiskCacheBackendTest, InvalidRankingsSuccess) { |
1317 ASSERT_TRUE(CopyTestCache(L"bad_rankings")); | 1267 ASSERT_TRUE(CopyTestCache(L"bad_rankings")); |
1318 DisableFirstCleanup(); | 1268 DisableFirstCleanup(); |
1319 SetDirectMode(); | 1269 SetDirectMode(); |
1320 InitCache(); | 1270 InitCache(); |
1321 BackendInvalidRankings(); | 1271 BackendInvalidRankings(); |
1322 } | 1272 } |
(...skipping 30 matching lines...) Expand all Loading... |
1353 void DiskCacheBackendTest::BackendDisable() { | 1303 void DiskCacheBackendTest::BackendDisable() { |
1354 disk_cache::Entry *entry1, *entry2; | 1304 disk_cache::Entry *entry1, *entry2; |
1355 void* iter = NULL; | 1305 void* iter = NULL; |
1356 ASSERT_EQ(net::OK, OpenNextEntry(&iter, &entry1)); | 1306 ASSERT_EQ(net::OK, OpenNextEntry(&iter, &entry1)); |
1357 | 1307 |
1358 EXPECT_NE(net::OK, OpenNextEntry(&iter, &entry2)); | 1308 EXPECT_NE(net::OK, OpenNextEntry(&iter, &entry2)); |
1359 EXPECT_EQ(2, cache_->GetEntryCount()); | 1309 EXPECT_EQ(2, cache_->GetEntryCount()); |
1360 EXPECT_NE(net::OK, CreateEntry("Something new", &entry2)); | 1310 EXPECT_NE(net::OK, CreateEntry("Something new", &entry2)); |
1361 | 1311 |
1362 entry1->Close(); | 1312 entry1->Close(); |
1363 FlushQueueForTest(); // Flushing the Close posts a task to restart the cache. | 1313 MessageLoop::current()->RunAllPending(); |
1364 FlushQueueForTest(); // This one actually allows that task to complete. | |
1365 | 1314 |
1366 EXPECT_EQ(0, cache_->GetEntryCount()); | 1315 EXPECT_EQ(0, cache_->GetEntryCount()); |
1367 } | 1316 } |
1368 | 1317 |
1369 TEST_F(DiskCacheBackendTest, DisableSuccess) { | 1318 TEST_F(DiskCacheBackendTest, DisableSuccess) { |
1370 ASSERT_TRUE(CopyTestCache(L"bad_rankings")); | 1319 ASSERT_TRUE(CopyTestCache(L"bad_rankings")); |
1371 DisableFirstCleanup(); | 1320 DisableFirstCleanup(); |
1372 SetDirectMode(); | 1321 SetDirectMode(); |
1373 InitCache(); | 1322 InitCache(); |
1374 BackendDisable(); | 1323 BackendDisable(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 disk_cache::Entry* entry; | 1358 disk_cache::Entry* entry; |
1410 void* iter = NULL; | 1359 void* iter = NULL; |
1411 int count = 0; | 1360 int count = 0; |
1412 while (OpenNextEntry(&iter, &entry) == net::OK) { | 1361 while (OpenNextEntry(&iter, &entry) == net::OK) { |
1413 ASSERT_TRUE(NULL != entry); | 1362 ASSERT_TRUE(NULL != entry); |
1414 entry->Close(); | 1363 entry->Close(); |
1415 count++; | 1364 count++; |
1416 ASSERT_LT(count, 9); | 1365 ASSERT_LT(count, 9); |
1417 }; | 1366 }; |
1418 | 1367 |
1419 FlushQueueForTest(); | 1368 MessageLoop::current()->RunAllPending(); |
1420 EXPECT_EQ(0, cache_->GetEntryCount()); | 1369 EXPECT_EQ(0, cache_->GetEntryCount()); |
1421 } | 1370 } |
1422 | 1371 |
1423 TEST_F(DiskCacheBackendTest, DisableSuccess2) { | 1372 TEST_F(DiskCacheBackendTest, DisableSuccess2) { |
1424 ASSERT_TRUE(CopyTestCache(L"list_loop")); | 1373 ASSERT_TRUE(CopyTestCache(L"list_loop")); |
1425 DisableFirstCleanup(); | 1374 DisableFirstCleanup(); |
1426 SetDirectMode(); | 1375 SetDirectMode(); |
1427 InitCache(); | 1376 InitCache(); |
1428 BackendDisable2(); | 1377 BackendDisable2(); |
1429 } | 1378 } |
(...skipping 28 matching lines...) Expand all Loading... |
1458 | 1407 |
1459 // If the index size changes when we disable the cache, we should not crash. | 1408 // If the index size changes when we disable the cache, we should not crash. |
1460 void DiskCacheBackendTest::BackendDisable3() { | 1409 void DiskCacheBackendTest::BackendDisable3() { |
1461 disk_cache::Entry *entry1, *entry2; | 1410 disk_cache::Entry *entry1, *entry2; |
1462 void* iter = NULL; | 1411 void* iter = NULL; |
1463 EXPECT_EQ(2, cache_->GetEntryCount()); | 1412 EXPECT_EQ(2, cache_->GetEntryCount()); |
1464 ASSERT_EQ(net::OK, OpenNextEntry(&iter, &entry1)); | 1413 ASSERT_EQ(net::OK, OpenNextEntry(&iter, &entry1)); |
1465 entry1->Close(); | 1414 entry1->Close(); |
1466 | 1415 |
1467 EXPECT_NE(net::OK, OpenNextEntry(&iter, &entry2)); | 1416 EXPECT_NE(net::OK, OpenNextEntry(&iter, &entry2)); |
1468 FlushQueueForTest(); | 1417 MessageLoop::current()->RunAllPending(); |
1469 | 1418 |
1470 ASSERT_EQ(net::OK, CreateEntry("Something new", &entry2)); | 1419 ASSERT_EQ(net::OK, CreateEntry("Something new", &entry2)); |
1471 entry2->Close(); | 1420 entry2->Close(); |
1472 | 1421 |
1473 EXPECT_EQ(1, cache_->GetEntryCount()); | 1422 EXPECT_EQ(1, cache_->GetEntryCount()); |
1474 } | 1423 } |
1475 | 1424 |
1476 TEST_F(DiskCacheBackendTest, DisableSuccess3) { | 1425 TEST_F(DiskCacheBackendTest, DisableSuccess3) { |
1477 ASSERT_TRUE(CopyTestCache(L"bad_rankings2")); | 1426 ASSERT_TRUE(CopyTestCache(L"bad_rankings2")); |
1478 DisableFirstCleanup(); | 1427 DisableFirstCleanup(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 EXPECT_EQ(kBufSize, entry3->WriteData(1, 0, buf, kBufSize, NULL, false)); | 1475 EXPECT_EQ(kBufSize, entry3->WriteData(1, 0, buf, kBufSize, NULL, false)); |
1527 | 1476 |
1528 std::string key = entry2->GetKey(); | 1477 std::string key = entry2->GetKey(); |
1529 EXPECT_EQ(sizeof(key2) - 1, key.size()); | 1478 EXPECT_EQ(sizeof(key2) - 1, key.size()); |
1530 key = entry3->GetKey(); | 1479 key = entry3->GetKey(); |
1531 EXPECT_EQ(sizeof(key3) - 1, key.size()); | 1480 EXPECT_EQ(sizeof(key3) - 1, key.size()); |
1532 | 1481 |
1533 entry1->Close(); | 1482 entry1->Close(); |
1534 entry2->Close(); | 1483 entry2->Close(); |
1535 entry3->Close(); | 1484 entry3->Close(); |
1536 FlushQueueForTest(); // Flushing the Close posts a task to restart the cache. | 1485 MessageLoop::current()->RunAllPending(); |
1537 FlushQueueForTest(); // This one actually allows that task to complete. | |
1538 | 1486 |
1539 EXPECT_EQ(0, cache_->GetEntryCount()); | 1487 EXPECT_EQ(0, cache_->GetEntryCount()); |
1540 } | 1488 } |
1541 | 1489 |
1542 TEST_F(DiskCacheBackendTest, DisableSuccess4) { | 1490 TEST_F(DiskCacheBackendTest, DisableSuccess4) { |
1543 ASSERT_TRUE(CopyTestCache(L"bad_rankings")); | 1491 ASSERT_TRUE(CopyTestCache(L"bad_rankings")); |
1544 DisableFirstCleanup(); | 1492 DisableFirstCleanup(); |
1545 SetDirectMode(); | 1493 SetDirectMode(); |
1546 InitCache(); | 1494 InitCache(); |
1547 BackendDisable4(); | 1495 BackendDisable4(); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1749 // another. | 1697 // another. |
1750 TEST_F(DiskCacheBackendTest, Histograms) { | 1698 TEST_F(DiskCacheBackendTest, Histograms) { |
1751 SetDirectMode(); | 1699 SetDirectMode(); |
1752 InitCache(); | 1700 InitCache(); |
1753 disk_cache::BackendImpl* backend_ = cache_impl_; // Needed be the macro. | 1701 disk_cache::BackendImpl* backend_ = cache_impl_; // Needed be the macro. |
1754 | 1702 |
1755 for (int i = 1; i < 3; i++) { | 1703 for (int i = 1; i < 3; i++) { |
1756 CACHE_UMA(HOURS, "FillupTime", i, 28); | 1704 CACHE_UMA(HOURS, "FillupTime", i, 28); |
1757 } | 1705 } |
1758 } | 1706 } |
OLD | NEW |