Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: net/disk_cache/backend_unittest.cc

Issue 118123004: Disk cache: Clarify API contract and delete spurious delay. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable test Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/disk_cache/disk_cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/port.h" 8 #include "base/port.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 Time middle_start = Time::Now(); 1597 Time middle_start = Time::Now();
1598 1598
1599 ASSERT_EQ(net::OK, CreateEntry("second", &entry)); 1599 ASSERT_EQ(net::OK, CreateEntry("second", &entry));
1600 entry->Close(); 1600 entry->Close();
1601 ASSERT_EQ(net::OK, CreateEntry("third", &entry)); 1601 ASSERT_EQ(net::OK, CreateEntry("third", &entry));
1602 entry->Close(); 1602 entry->Close();
1603 FlushQueueForTest(); 1603 FlushQueueForTest();
1604 1604
1605 AddDelay(); 1605 AddDelay();
1606 Time middle_end = Time::Now(); 1606 Time middle_end = Time::Now();
1607 AddDelay();
gavinp 2014/03/21 11:20:39 This delay is not spurious; for caches that use co
rvargas (doing something else) 2014/03/21 18:14:41 Could you expand on that? The test as it is _with
1608 1607
1609 ASSERT_EQ(net::OK, CreateEntry("fourth", &entry)); 1608 ASSERT_EQ(net::OK, CreateEntry("fourth", &entry));
1610 entry->Close(); 1609 entry->Close();
1611 ASSERT_EQ(net::OK, OpenEntry("fourth", &entry)); 1610 ASSERT_EQ(net::OK, OpenEntry("fourth", &entry));
1612 entry->Close(); 1611 entry->Close();
1613 FlushQueueForTest(); 1612 FlushQueueForTest();
1614 1613
1615 AddDelay(); 1614 AddDelay();
1616 Time final = Time::Now(); 1615 Time final = Time::Now();
1617 1616
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
3223 SetSimpleCacheMode(); 3222 SetSimpleCacheMode();
3224 SetMaxSize(0x100000); 3223 SetMaxSize(0x100000);
3225 BackendLoad(); 3224 BackendLoad();
3226 } 3225 }
3227 3226
3228 TEST_F(DiskCacheBackendTest, SimpleDoomRecent) { 3227 TEST_F(DiskCacheBackendTest, SimpleDoomRecent) {
3229 SetSimpleCacheMode(); 3228 SetSimpleCacheMode();
3230 BackendDoomRecent(); 3229 BackendDoomRecent();
3231 } 3230 }
3232 3231
3233 TEST_F(DiskCacheBackendTest, SimpleDoomBetween) { 3232 // crbug.com/330926
3233 TEST_F(DiskCacheBackendTest, DISABLED_SimpleDoomBetween) {
3234 SetSimpleCacheMode(); 3234 SetSimpleCacheMode();
3235 BackendDoomBetween(); 3235 BackendDoomBetween();
3236 } 3236 }
3237 3237
3238 TEST_F(DiskCacheBackendTest, SimpleCacheDoomAll) { 3238 TEST_F(DiskCacheBackendTest, SimpleCacheDoomAll) {
3239 SetSimpleCacheMode(); 3239 SetSimpleCacheMode();
3240 BackendDoomAll(); 3240 BackendDoomAll();
3241 } 3241 }
3242 3242
3243 TEST_F(DiskCacheBackendTest, SimpleCacheAppCacheOnlyDoomAll) { 3243 TEST_F(DiskCacheBackendTest, SimpleCacheAppCacheOnlyDoomAll) {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
3488 void* iter = NULL; 3488 void* iter = NULL;
3489 size_t count = 0; 3489 size_t count = 0;
3490 ASSERT_TRUE(EnumerateAndMatchKeys(-1, &iter, &keys_to_match, &count)); 3490 ASSERT_TRUE(EnumerateAndMatchKeys(-1, &iter, &keys_to_match, &count));
3491 cache_->EndEnumeration(&iter); 3491 cache_->EndEnumeration(&iter);
3492 3492
3493 EXPECT_EQ(key_pool.size(), count); 3493 EXPECT_EQ(key_pool.size(), count);
3494 EXPECT_TRUE(keys_to_match.empty()); 3494 EXPECT_TRUE(keys_to_match.empty());
3495 } 3495 }
3496 3496
3497 #endif // defined(OS_POSIX) 3497 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « no previous file | net/disk_cache/disk_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698