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

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

Issue 1416213003: Add DatagramClientSocket::BindToDefaultNetwork(),GetBoundNetwork() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « net/base/network_change_notifier.cc ('k') | net/socket/socket_test_util.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/address_sorter_posix.h" 5 #include "net/dns/address_sorter_posix.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/base/net_util.h" 10 #include "net/base/net_util.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return OK; 52 return OK;
53 } 53 }
54 int GetLocalAddress(IPEndPoint* address) const override { 54 int GetLocalAddress(IPEndPoint* address) const override {
55 if (!connected_) 55 if (!connected_)
56 return ERR_UNEXPECTED; 56 return ERR_UNEXPECTED;
57 *address = local_endpoint_; 57 *address = local_endpoint_;
58 return OK; 58 return OK;
59 } 59 }
60 int BindToNetwork(NetworkChangeNotifier::NetworkHandle network) override { 60 int BindToNetwork(NetworkChangeNotifier::NetworkHandle network) override {
61 NOTIMPLEMENTED(); 61 NOTIMPLEMENTED();
62 return OK; 62 return ERR_NOT_IMPLEMENTED;
63 }
64 int BindToDefaultNetwork() override {
65 NOTIMPLEMENTED();
66 return ERR_NOT_IMPLEMENTED;
67 }
68 NetworkChangeNotifier::NetworkHandle GetBoundNetwork() override {
69 return NetworkChangeNotifier::kInvalidNetworkHandle;
63 } 70 }
64 71
65 int Connect(const IPEndPoint& remote) override { 72 int Connect(const IPEndPoint& remote) override {
66 if (connected_) 73 if (connected_)
67 return ERR_UNEXPECTED; 74 return ERR_UNEXPECTED;
68 AddressMapping::const_iterator it = mapping_->find(remote.address()); 75 AddressMapping::const_iterator it = mapping_->find(remote.address());
69 if (it == mapping_->end()) 76 if (it == mapping_->end())
70 return ERR_FAILED; 77 return ERR_FAILED;
71 connected_ = true; 78 connected_ = true;
72 local_endpoint_ = IPEndPoint(it->second, 39874 /* arbitrary port */); 79 local_endpoint_ = IPEndPoint(it->second, 39874 /* arbitrary port */);
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 AddMapping("4000::1", "4000::10"); // global unicast 321 AddMapping("4000::1", "4000::10"); // global unicast
315 AddMapping("ff32::2", "fe81::20"); // deprecated link-local multicast 322 AddMapping("ff32::2", "fe81::20"); // deprecated link-local multicast
316 GetSourceInfo("fe81::20")->deprecated = true; 323 GetSourceInfo("fe81::20")->deprecated = true;
317 const char* const addresses[] = { "ff3e::1", "ff32::2", "4000::1", "ff32::1", 324 const char* const addresses[] = { "ff3e::1", "ff32::2", "4000::1", "ff32::1",
318 "::1", "8.0.0.1", NULL }; 325 "::1", "8.0.0.1", NULL };
319 const int order[] = { 4, 3, 0, 2, 1, -1 }; 326 const int order[] = { 4, 3, 0, 2, 1, -1 };
320 Verify(addresses, order); 327 Verify(addresses, order);
321 } 328 }
322 329
323 } // namespace net 330 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_change_notifier.cc ('k') | net/socket/socket_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698