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/socket/socket_test_util.h" | 5 #include "net/socket/socket_test_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 | 1341 |
1342 int MockUDPClientSocket::BindToNetwork( | 1342 int MockUDPClientSocket::BindToNetwork( |
1343 NetworkChangeNotifier::NetworkHandle network) { | 1343 NetworkChangeNotifier::NetworkHandle network) { |
1344 return ERR_NOT_IMPLEMENTED; | 1344 return ERR_NOT_IMPLEMENTED; |
1345 } | 1345 } |
1346 | 1346 |
1347 int MockUDPClientSocket::BindToDefaultNetwork() { | 1347 int MockUDPClientSocket::BindToDefaultNetwork() { |
1348 return ERR_NOT_IMPLEMENTED; | 1348 return ERR_NOT_IMPLEMENTED; |
1349 } | 1349 } |
1350 | 1350 |
1351 NetworkChangeNotifier::NetworkHandle MockUDPClientSocket::GetBoundNetwork() { | 1351 NetworkChangeNotifier::NetworkHandle MockUDPClientSocket::GetBoundNetwork() |
| 1352 const { |
1352 return NetworkChangeNotifier::kInvalidNetworkHandle; | 1353 return NetworkChangeNotifier::kInvalidNetworkHandle; |
1353 } | 1354 } |
1354 | 1355 |
1355 int MockUDPClientSocket::Connect(const IPEndPoint& address) { | 1356 int MockUDPClientSocket::Connect(const IPEndPoint& address) { |
1356 if (!data_) | 1357 if (!data_) |
1357 return ERR_UNEXPECTED; | 1358 return ERR_UNEXPECTED; |
1358 connected_ = true; | 1359 connected_ = true; |
1359 peer_addr_ = address; | 1360 peer_addr_ = address; |
1360 return data_->connect_data().result; | 1361 return data_->connect_data().result; |
1361 } | 1362 } |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1695 } | 1696 } |
1696 | 1697 |
1697 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { | 1698 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { |
1698 int64_t total = 0; | 1699 int64_t total = 0; |
1699 for (const MockWrite* write = writes; write != writes + writes_size; ++write) | 1700 for (const MockWrite* write = writes; write != writes + writes_size; ++write) |
1700 total += write->data_len; | 1701 total += write->data_len; |
1701 return total; | 1702 return total; |
1702 } | 1703 } |
1703 | 1704 |
1704 } // namespace net | 1705 } // namespace net |
OLD | NEW |