diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-11 00:12:15 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-11 00:12:15 +0000 |
commit | 9393b71775c7ea64004df0461d0564361bddd553 (patch) | |
tree | ec7f19a42d4e5907d4fffe862b672984e08d8f76 /net/http/http_cache_unittest.cc | |
parent | defdc7d6edbccc329940f717038c8769ae125d52 (diff) | |
download | chromium_src-9393b71775c7ea64004df0461d0564361bddd553.zip chromium_src-9393b71775c7ea64004df0461d0564361bddd553.tar.gz chromium_src-9393b71775c7ea64004df0461d0564361bddd553.tar.bz2 |
Http Cache: Add a load log to the DoomEntry operation.
BUG=26729
TEST=unittest
Review URL: http://codereview.chromium.org/603011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38713 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_cache_unittest.cc')
-rw-r--r-- | net/http/http_cache_unittest.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc index c62052f..663176c 100644 --- a/net/http/http_cache_unittest.cc +++ b/net/http/http_cache_unittest.cc @@ -1106,14 +1106,31 @@ TEST(HttpCache, SimpleGET_LoadPreferringCache_Miss) { TEST(HttpCache, SimpleGET_LoadBypassCache) { MockHttpCache cache; - // write to the cache + // Write to the cache. RunTransactionTest(cache.http_cache(), kSimpleGET_Transaction); - // force this transaction to write to the cache again + // Force this transaction to write to the cache again. MockTransaction transaction(kSimpleGET_Transaction); transaction.load_flags |= net::LOAD_BYPASS_CACHE; - RunTransactionTest(cache.http_cache(), transaction); + scoped_refptr<net::LoadLog> log(new net::LoadLog(net::LoadLog::kUnbounded)); + + RunTransactionTestWithLog(cache.http_cache(), transaction, log); + + // Check that the LoadLog was filled as expected. + EXPECT_EQ(6u, log->entries().size()); + EXPECT_TRUE(net::LogContainsBeginEvent( + *log, 0, net::LoadLog::TYPE_HTTP_CACHE_DOOM_ENTRY)); + EXPECT_TRUE(net::LogContainsEndEvent( + *log, 1, net::LoadLog::TYPE_HTTP_CACHE_DOOM_ENTRY)); + EXPECT_TRUE(net::LogContainsBeginEvent( + *log, 2, net::LoadLog::TYPE_HTTP_CACHE_CREATE_ENTRY)); + EXPECT_TRUE(net::LogContainsEndEvent( + *log, 3, net::LoadLog::TYPE_HTTP_CACHE_CREATE_ENTRY)); + EXPECT_TRUE(net::LogContainsBeginEvent( + *log, 4, net::LoadLog::TYPE_HTTP_CACHE_WAITING)); + EXPECT_TRUE(net::LogContainsEndEvent( + *log, 5, net::LoadLog::TYPE_HTTP_CACHE_WAITING)); EXPECT_EQ(2, cache.network_layer()->transaction_count()); EXPECT_EQ(0, cache.disk_cache()->open_count()); |