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

Side by Side Diff: net/dns/host_resolver_impl_unittest.cc

Issue 12681017: [net/dns] When serving AF_UNSPEC addresses from DnsHosts, serve one from each family. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move comment and ->clear Created 7 years, 8 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 | « net/dns/host_resolver_impl.cc ('k') | no next file » | 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 "net/dns/host_resolver_impl.h" 5 #include "net/dns/host_resolver_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 Request* req1 = CreateRequest("er_ipv4", 80); 1368 Request* req1 = CreateRequest("er_ipv4", 80);
1369 EXPECT_EQ(OK, req1->Resolve()); 1369 EXPECT_EQ(OK, req1->Resolve());
1370 EXPECT_TRUE(req1->HasOneAddress("127.0.0.1", 80)); 1370 EXPECT_TRUE(req1->HasOneAddress("127.0.0.1", 80));
1371 1371
1372 Request* req2 = CreateRequest("er_ipv6", 80); 1372 Request* req2 = CreateRequest("er_ipv6", 80);
1373 EXPECT_EQ(OK, req2->Resolve()); 1373 EXPECT_EQ(OK, req2->Resolve());
1374 EXPECT_TRUE(req2->HasOneAddress("::1", 80)); 1374 EXPECT_TRUE(req2->HasOneAddress("::1", 80));
1375 1375
1376 Request* req3 = CreateRequest("er_both", 80); 1376 Request* req3 = CreateRequest("er_both", 80);
1377 EXPECT_EQ(OK, req3->Resolve()); 1377 EXPECT_EQ(OK, req3->Resolve());
1378 EXPECT_TRUE(req3->HasOneAddress("127.0.0.1", 80) || 1378 EXPECT_TRUE(req3->HasAddress("127.0.0.1", 80) &&
1379 req3->HasOneAddress("::1", 80)); 1379 req3->HasAddress("::1", 80));
1380 1380
1381 // Requests with specified AddressFamily. 1381 // Requests with specified AddressFamily.
1382 Request* req4 = CreateRequest("er_ipv4", 80, MEDIUM, ADDRESS_FAMILY_IPV4); 1382 Request* req4 = CreateRequest("er_ipv4", 80, MEDIUM, ADDRESS_FAMILY_IPV4);
1383 EXPECT_EQ(OK, req4->Resolve()); 1383 EXPECT_EQ(OK, req4->Resolve());
1384 EXPECT_TRUE(req4->HasOneAddress("127.0.0.1", 80)); 1384 EXPECT_TRUE(req4->HasOneAddress("127.0.0.1", 80));
1385 1385
1386 Request* req5 = CreateRequest("er_ipv6", 80, MEDIUM, ADDRESS_FAMILY_IPV6); 1386 Request* req5 = CreateRequest("er_ipv6", 80, MEDIUM, ADDRESS_FAMILY_IPV6);
1387 EXPECT_EQ(OK, req5->Resolve()); 1387 EXPECT_EQ(OK, req5->Resolve());
1388 EXPECT_TRUE(req5->HasOneAddress("::1", 80)); 1388 EXPECT_TRUE(req5->HasOneAddress("::1", 80));
1389 1389
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 // Make |proc_| default to failures. 1472 // Make |proc_| default to failures.
1473 proc_->AddRuleForAllFamilies("", ""); 1473 proc_->AddRuleForAllFamilies("", "");
1474 1474
1475 // DnsTask should still be enabled. 1475 // DnsTask should still be enabled.
1476 Request* req = CreateRequest("ok_last", 80); 1476 Request* req = CreateRequest("ok_last", 80);
1477 EXPECT_EQ(ERR_IO_PENDING, req->Resolve()); 1477 EXPECT_EQ(ERR_IO_PENDING, req->Resolve());
1478 EXPECT_EQ(OK, req->WaitForResult()); 1478 EXPECT_EQ(OK, req->WaitForResult());
1479 } 1479 }
1480 1480
1481 } // namespace net 1481 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/host_resolver_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698