diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 19:59:36 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 19:59:36 +0000 |
commit | 60c4c41ce3ed1fa0697daf274233d84febf6233c (patch) | |
tree | 7b6bfe29f7b6526b4c63ce49ab7a7ffcd20d3bbf /net/base/host_resolver_impl_unittest.cc | |
parent | 3203c5e35bba5266fe1d149875c3a9815ee9c214 (diff) | |
download | chromium_src-60c4c41ce3ed1fa0697daf274233d84febf6233c.zip chromium_src-60c4c41ce3ed1fa0697daf274233d84febf6233c.tar.gz chromium_src-60c4c41ce3ed1fa0697daf274233d84febf6233c.tar.bz2 |
Improve the display of LoadLogs when truncation occurs.
Rather than drop all subsequent entries, we now preserve the final entry that was appended to the log.
This way, even if entries have been dropped, we can still infer what the total time was, and what the exit condition was.
Also makes LoadLog take the bound as a required parameter.
BUG=none
TEST=LoadLogUtilTest.DisplayOfTruncated
Review URL: http://codereview.chromium.org/363025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31274 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/host_resolver_impl_unittest.cc')
-rw-r--r-- | net/base/host_resolver_impl_unittest.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/base/host_resolver_impl_unittest.cc b/net/base/host_resolver_impl_unittest.cc index 63e06a7..1ec38b2 100644 --- a/net/base/host_resolver_impl_unittest.cc +++ b/net/base/host_resolver_impl_unittest.cc @@ -30,8 +30,8 @@ namespace net { namespace { -static const int kMaxCacheEntries = 100; -static const int kMaxCacheAgeMs = 60000; +const int kMaxCacheEntries = 100; +const int kMaxCacheAgeMs = 60000; // A variant of WaitingHostResolverProc that pushes each host mapped into a // list. @@ -189,7 +189,7 @@ TEST_F(HostResolverImplTest, SynchronousLookup) { new HostResolverImpl(resolver_proc, kMaxCacheEntries, kMaxCacheAgeMs)); HostResolver::RequestInfo info("just.testing", kPortnum); - scoped_refptr<LoadLog> log(new LoadLog); + scoped_refptr<LoadLog> log(new LoadLog(LoadLog::kUnbounded)); int err = host_resolver->Resolve(info, &adrlist, NULL, NULL, log); EXPECT_EQ(OK, err); @@ -221,7 +221,7 @@ TEST_F(HostResolverImplTest, AsynchronousLookup) { new HostResolverImpl(resolver_proc, kMaxCacheEntries, kMaxCacheAgeMs)); HostResolver::RequestInfo info("just.testing", kPortnum); - scoped_refptr<LoadLog> log(new LoadLog); + scoped_refptr<LoadLog> log(new LoadLog(LoadLog::kUnbounded)); int err = host_resolver->Resolve(info, &adrlist, &callback_, NULL, log); EXPECT_EQ(ERR_IO_PENDING, err); @@ -252,7 +252,7 @@ TEST_F(HostResolverImplTest, CanceledAsynchronousLookup) { scoped_refptr<WaitingHostResolverProc> resolver_proc = new WaitingHostResolverProc(NULL); - scoped_refptr<LoadLog> log(new LoadLog); + scoped_refptr<LoadLog> log(new LoadLog(LoadLog::kUnbounded)); { scoped_refptr<HostResolver> host_resolver( new HostResolverImpl(resolver_proc, kMaxCacheEntries, kMaxCacheAgeMs)); @@ -822,7 +822,7 @@ TEST_F(HostResolverImplTest, Observers) { // Resolve "host1". HostResolver::RequestInfo info1("host1", 70); - scoped_refptr<LoadLog> log(new LoadLog); + scoped_refptr<LoadLog> log(new LoadLog(LoadLog::kUnbounded)); int rv = host_resolver->Resolve(info1, &addrlist, NULL, NULL, log); EXPECT_EQ(OK, rv); |