| OLD | NEW |
| 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/base/host_resolver_impl.h" | 5 #include "net/base/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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 // On completing the first request, start another request for "a". | 753 // On completing the first request, start another request for "a". |
| 754 // Since caching is disabled, this will result in another async request. | 754 // Since caching is disabled, this will result in another async request. |
| 755 EXPECT_EQ(ERR_IO_PENDING, CreateRequest("a", 70)->Resolve()); | 755 EXPECT_EQ(ERR_IO_PENDING, CreateRequest("a", 70)->Resolve()); |
| 756 } | 756 } |
| 757 } | 757 } |
| 758 }; | 758 }; |
| 759 set_handler(new MyHandler()); | 759 set_handler(new MyHandler()); |
| 760 | 760 |
| 761 // Turn off caching for this host resolver. | 761 // Turn off caching for this host resolver. |
| 762 resolver_.reset(new HostResolverImpl( | 762 resolver_.reset(new HostResolverImpl( |
| 763 NULL, | 763 scoped_ptr<HostCache>(NULL), |
| 764 DefaultLimits(), | 764 DefaultLimits(), |
| 765 DefaultParams(proc_), | 765 DefaultParams(proc_), |
| 766 scoped_ptr<DnsConfigService>(NULL), | 766 scoped_ptr<DnsConfigService>(NULL), |
| 767 scoped_ptr<DnsClient>(NULL), | 767 scoped_ptr<DnsClient>(NULL), |
| 768 NULL)); | 768 NULL)); |
| 769 | 769 |
| 770 for (size_t i = 0; i < 4; ++i) { | 770 for (size_t i = 0; i < 4; ++i) { |
| 771 EXPECT_EQ(ERR_IO_PENDING, CreateRequest("a", 80 + i)->Resolve()) << i; | 771 EXPECT_EQ(ERR_IO_PENDING, CreateRequest("a", 80 + i)->Resolve()) << i; |
| 772 } | 772 } |
| 773 | 773 |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 proc_->SignalMultiple(requests_.size()); | 1416 proc_->SignalMultiple(requests_.size()); |
| 1417 | 1417 |
| 1418 for (size_t i = 0; i < 2; ++i) | 1418 for (size_t i = 0; i < 2; ++i) |
| 1419 EXPECT_EQ(ERR_NAME_NOT_RESOLVED, requests_[i]->WaitForResult()) << i; | 1419 EXPECT_EQ(ERR_NAME_NOT_RESOLVED, requests_[i]->WaitForResult()) << i; |
| 1420 | 1420 |
| 1421 for (size_t i = 2; i < requests_.size(); ++i) | 1421 for (size_t i = 2; i < requests_.size(); ++i) |
| 1422 EXPECT_EQ(OK, requests_[i]->WaitForResult()) << i; | 1422 EXPECT_EQ(OK, requests_[i]->WaitForResult()) << i; |
| 1423 } | 1423 } |
| 1424 | 1424 |
| 1425 } // namespace net | 1425 } // namespace net |
| OLD | NEW |