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

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

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « net/cookies/parsed_cookie.h ('k') | net/dns/mdns_client_impl.h » ('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/dns_config_service.h" 5 #include "net/dns/dns_config_service.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/cancelable_callback.h" 9 #include "base/cancelable_callback.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 23 matching lines...) Expand all
34 protected: 34 protected:
35 NameServerClassifier::NameServersType Classify( 35 NameServerClassifier::NameServersType Classify(
36 const std::string& servers_string) { 36 const std::string& servers_string) {
37 std::vector<std::string> server_strings; 37 std::vector<std::string> server_strings;
38 base::SplitString(servers_string, ' ', &server_strings); 38 base::SplitString(servers_string, ' ', &server_strings);
39 39
40 std::vector<IPEndPoint> servers; 40 std::vector<IPEndPoint> servers;
41 for (std::vector<std::string>::const_iterator it = server_strings.begin(); 41 for (std::vector<std::string>::const_iterator it = server_strings.begin();
42 it != server_strings.end(); 42 it != server_strings.end();
43 ++it) { 43 ++it) {
44 if (*it == "") 44 if (it->empty())
45 continue; 45 continue;
46 46
47 IPAddressNumber address; 47 IPAddressNumber address;
48 bool parsed = ParseIPLiteralToNumber(*it, &address); 48 bool parsed = ParseIPLiteralToNumber(*it, &address);
49 EXPECT_TRUE(parsed); 49 EXPECT_TRUE(parsed);
50 servers.push_back(IPEndPoint(address, dns_protocol::kDefaultPort)); 50 servers.push_back(IPEndPoint(address, dns_protocol::kDefaultPort));
51 } 51 }
52 52
53 return classifier_.GetNameServersType(servers); 53 return classifier_.GetNameServersType(servers);
54 } 54 }
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 base::Unretained(this))); 343 base::Unretained(this)));
344 base::TimeDelta kTimeout = TestTimeouts::action_max_timeout(); 344 base::TimeDelta kTimeout = TestTimeouts::action_max_timeout();
345 WaitForConfig(kTimeout); 345 WaitForConfig(kTimeout);
346 ASSERT_TRUE(last_config_.IsValid()) << "Did not receive DnsConfig in " << 346 ASSERT_TRUE(last_config_.IsValid()) << "Did not receive DnsConfig in " <<
347 kTimeout.InSecondsF() << "s"; 347 kTimeout.InSecondsF() << "s";
348 } 348 }
349 #endif // OS_POSIX || OS_WIN 349 #endif // OS_POSIX || OS_WIN
350 350
351 } // namespace net 351 } // namespace net
352 352
OLDNEW
« no previous file with comments | « net/cookies/parsed_cookie.h ('k') | net/dns/mdns_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698