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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh 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/mock_host_resolver.cc ('k') | net/ftp/ftp_util.cc » ('j') | 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/single_request_host_resolver.h" 5 #include "net/dns/single_request_host_resolver.h"
6 6
7 #include "net/base/address_list.h" 7 #include "net/base/address_list.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "net/base/net_log.h" 9 #include "net/base/net_log.h"
10 #include "net/base/test_completion_callback.h" 10 #include "net/base/test_completion_callback.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 RequestHandle outstanding_request_; 61 RequestHandle outstanding_request_;
62 62
63 DISALLOW_COPY_AND_ASSIGN(HangingHostResolver); 63 DISALLOW_COPY_AND_ASSIGN(HangingHostResolver);
64 }; 64 };
65 65
66 // Test that a regular end-to-end lookup returns the expected result. 66 // Test that a regular end-to-end lookup returns the expected result.
67 TEST(SingleRequestHostResolverTest, NormalResolve) { 67 TEST(SingleRequestHostResolverTest, NormalResolve) {
68 // Create a host resolver dependency that returns address "199.188.1.166" 68 // Create a host resolver dependency that returns address "199.188.1.166"
69 // for resolutions of "watsup". 69 // for resolutions of "watsup".
70 MockHostResolver resolver; 70 MockHostResolver resolver;
71 resolver.rules()->AddIPLiteralRule("watsup", "199.188.1.166", ""); 71 resolver.rules()->AddIPLiteralRule("watsup", "199.188.1.166", std::string());
72 72
73 SingleRequestHostResolver single_request_resolver(&resolver); 73 SingleRequestHostResolver single_request_resolver(&resolver);
74 74
75 // Resolve "watsup:90" using our SingleRequestHostResolver. 75 // Resolve "watsup:90" using our SingleRequestHostResolver.
76 AddressList addrlist; 76 AddressList addrlist;
77 TestCompletionCallback callback; 77 TestCompletionCallback callback;
78 HostResolver::RequestInfo request(HostPortPair("watsup", 90)); 78 HostResolver::RequestInfo request(HostPortPair("watsup", 90));
79 int rv = single_request_resolver.Resolve( 79 int rv = single_request_resolver.Resolve(
80 request, &addrlist, callback.callback(), BoundNetLog()); 80 request, &addrlist, callback.callback(), BoundNetLog());
81 EXPECT_EQ(ERR_IO_PENDING, rv); 81 EXPECT_EQ(ERR_IO_PENDING, rv);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 SingleRequestHostResolver single_request_resolver(&resolver); 115 SingleRequestHostResolver single_request_resolver(&resolver);
116 single_request_resolver.Cancel(); 116 single_request_resolver.Cancel();
117 117
118 // To pass, HangingHostResolver should not have received a cancellation 118 // To pass, HangingHostResolver should not have received a cancellation
119 // request (since there is nothing to cancel). If it does, it will crash. 119 // request (since there is nothing to cancel). If it does, it will crash.
120 } 120 }
121 121
122 } // namespace 122 } // namespace
123 123
124 } // namespace net 124 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/mock_host_resolver.cc ('k') | net/ftp/ftp_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698