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

Unified Diff: net/dns/async_host_resolver_unittest.cc

Issue 7492059: HostResolver: don't interpret NULL callback argument as a request to do synchronous resolution. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged common code from Resolve and ResolveFromCache to a single function. Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: net/dns/async_host_resolver_unittest.cc
diff --git a/net/dns/async_host_resolver_unittest.cc b/net/dns/async_host_resolver_unittest.cc
index 9d6f2b7431aff8d30c56d4a8b01f01febfdd5f1f..2f34ec835c66a5929ac276ea122005ad77ab21f7 100644
--- a/net/dns/async_host_resolver_unittest.cc
+++ b/net/dns/async_host_resolver_unittest.cc
@@ -179,13 +179,10 @@ TEST_F(AsyncHostResolverTest, IPv6LiteralLookup) {
}
TEST_F(AsyncHostResolverTest, CachedLookup) {
- info0_.set_only_use_cached_response(true);
- int rv = resolver_->Resolve(info0_, &addrlist0_, NULL, NULL,
- BoundNetLog());
- EXPECT_EQ(ERR_NAME_NOT_RESOLVED, rv);
+ int rv = resolver_->ResolveFromCache(info0_, &addrlist0_, BoundNetLog());
+ EXPECT_EQ(ERR_DNS_CACHE_MISS, rv);
// Cache the result of |info0_| lookup.
- info0_.set_only_use_cached_response(false);
rv = resolver_->Resolve(info0_, &addrlist0_, &callback0_, NULL,
BoundNetLog());
EXPECT_EQ(ERR_IO_PENDING, rv);
@@ -195,9 +192,7 @@ TEST_F(AsyncHostResolverTest, CachedLookup) {
// Now lookup |info0_| from cache only, store results in |addrlist1_|,
// should succeed synchronously.
- info0_.set_only_use_cached_response(true);
- rv = resolver_->Resolve(info0_, &addrlist1_, NULL, NULL,
- BoundNetLog());
+ rv = resolver_->ResolveFromCache(info0_, &addrlist1_, BoundNetLog());
EXPECT_EQ(OK, rv);
VerifyAddressList(ip_addresses0_, kPortNum, addrlist1_);
}

Powered by Google App Engine
This is Rietveld 408576698