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

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

Issue 10831277: [net] Change factory methods for HostResolver and HostCache to return a scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 2 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
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/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 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 // On completing the first request, start another request for "a". 751 // On completing the first request, start another request for "a".
752 // Since caching is disabled, this will result in another async request. 752 // Since caching is disabled, this will result in another async request.
753 EXPECT_EQ(ERR_IO_PENDING, CreateRequest("a", 70)->Resolve()); 753 EXPECT_EQ(ERR_IO_PENDING, CreateRequest("a", 70)->Resolve());
754 } 754 }
755 } 755 }
756 }; 756 };
757 set_handler(new MyHandler()); 757 set_handler(new MyHandler());
758 758
759 // Turn off caching for this host resolver. 759 // Turn off caching for this host resolver.
760 resolver_.reset(new HostResolverImpl( 760 resolver_.reset(new HostResolverImpl(
761 NULL, 761 scoped_ptr<HostCache>(NULL),
darin (slow to review) 2012/10/09 17:38:34 nit: NULL parameter is unnecessary. just call the
szym 2012/10/09 21:40:43 Done.
762 DefaultLimits(), 762 DefaultLimits(),
763 DefaultParams(proc_), 763 DefaultParams(proc_),
764 scoped_ptr<DnsClient>(NULL), 764 scoped_ptr<DnsClient>(NULL),
darin (slow to review) 2012/10/09 17:38:34 same nit here
szym 2012/10/09 21:40:43 Done.
765 NULL)); 765 NULL));
766 766
767 for (size_t i = 0; i < 4; ++i) { 767 for (size_t i = 0; i < 4; ++i) {
768 EXPECT_EQ(ERR_IO_PENDING, CreateRequest("a", 80 + i)->Resolve()) << i; 768 EXPECT_EQ(ERR_IO_PENDING, CreateRequest("a", 80 + i)->Resolve()) << i;
769 } 769 }
770 770
771 proc_->SignalMultiple(2u); // One for "a". One for the second "a". 771 proc_->SignalMultiple(2u); // One for "a". One for the second "a".
772 772
773 EXPECT_EQ(OK, requests_[0]->WaitForResult()); 773 EXPECT_EQ(OK, requests_[0]->WaitForResult());
774 ASSERT_EQ(5u, requests_.size()); 774 ASSERT_EQ(5u, requests_.size());
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 proc_->SignalMultiple(requests_.size()); 1411 proc_->SignalMultiple(requests_.size());
1412 1412
1413 for (size_t i = 0; i < 2; ++i) 1413 for (size_t i = 0; i < 2; ++i)
1414 EXPECT_EQ(ERR_NAME_NOT_RESOLVED, requests_[i]->WaitForResult()) << i; 1414 EXPECT_EQ(ERR_NAME_NOT_RESOLVED, requests_[i]->WaitForResult()) << i;
1415 1415
1416 for (size_t i = 2; i < requests_.size(); ++i) 1416 for (size_t i = 2; i < requests_.size(); ++i)
1417 EXPECT_EQ(OK, requests_[i]->WaitForResult()) << i; 1417 EXPECT_EQ(OK, requests_[i]->WaitForResult()) << i;
1418 } 1418 }
1419 1419
1420 } // namespace net 1420 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698