diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-24 18:06:15 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-24 18:06:15 +0000 |
commit | b87b23727abd34f94fc25377424e4605b249fbc2 (patch) | |
tree | dd659392849e0b0fbbb90e3ee610437dfcc6b134 /net/disk_cache/backend_unittest.cc | |
parent | 6833846f5fc1334e8ce152e00bb80e0bfffce0c5 (diff) | |
download | chromium_src-b87b23727abd34f94fc25377424e4605b249fbc2.zip chromium_src-b87b23727abd34f94fc25377424e4605b249fbc2.tar.gz chromium_src-b87b23727abd34f94fc25377424e4605b249fbc2.tar.bz2 |
Disk cache: Avoid restarting the cache while it may be in use.
Now the code that releases resources runs from the message loop
so that methods can cause the cache to disable itself while
still being able to touch internal state.
BUG=17604
TEST=unittests.
Review URL: http://codereview.chromium.org/159327
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/backend_unittest.cc')
-rw-r--r-- | net/disk_cache/backend_unittest.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc index a1127a6..31df938 100644 --- a/net/disk_cache/backend_unittest.cc +++ b/net/disk_cache/backend_unittest.cc @@ -1099,6 +1099,7 @@ void DiskCacheBackendTest::BackendInvalidRankings() { EXPECT_EQ(2, cache_->GetEntryCount()); EXPECT_FALSE(cache_->OpenNextEntry(&iter, &entry)); + MessageLoop::current()->RunAllPending(); EXPECT_EQ(0, cache_->GetEntryCount()); } @@ -1149,6 +1150,7 @@ void DiskCacheBackendTest::BackendDisable() { EXPECT_FALSE(cache_->CreateEntry("Something new", &entry2)); entry1->Close(); + MessageLoop::current()->RunAllPending(); EXPECT_EQ(0, cache_->GetEntryCount()); } @@ -1203,6 +1205,7 @@ void DiskCacheBackendTest::BackendDisable2() { ASSERT_LT(count, 9); }; + MessageLoop::current()->RunAllPending(); EXPECT_EQ(0, cache_->GetEntryCount()); } @@ -1251,6 +1254,8 @@ void DiskCacheBackendTest::BackendDisable3() { entry1->Close(); EXPECT_FALSE(cache_->OpenNextEntry(&iter, &entry2)); + MessageLoop::current()->RunAllPending(); + ASSERT_TRUE(cache_->CreateEntry("Something new", &entry2)); entry2->Close(); |