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/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 *address = IPEndPoint(ip, 123); | 1491 *address = IPEndPoint(ip, 123); |
1492 return OK; | 1492 return OK; |
1493 } | 1493 } |
1494 | 1494 |
1495 const BoundNetLog& MockUDPClientSocket::NetLog() const { | 1495 const BoundNetLog& MockUDPClientSocket::NetLog() const { |
1496 return net_log_; | 1496 return net_log_; |
1497 } | 1497 } |
1498 | 1498 |
1499 int MockUDPClientSocket::Connect(const IPEndPoint& address) { | 1499 int MockUDPClientSocket::Connect(const IPEndPoint& address) { |
1500 connected_ = true; | 1500 connected_ = true; |
| 1501 peer_addr_ = address; |
1501 return OK; | 1502 return OK; |
1502 } | 1503 } |
1503 | 1504 |
1504 void MockUDPClientSocket::OnReadComplete(const MockRead& data) { | 1505 void MockUDPClientSocket::OnReadComplete(const MockRead& data) { |
1505 // There must be a read pending. | 1506 // There must be a read pending. |
1506 DCHECK(pending_buf_); | 1507 DCHECK(pending_buf_); |
1507 // You can't complete a read with another ERR_IO_PENDING status code. | 1508 // You can't complete a read with another ERR_IO_PENDING status code. |
1508 DCHECK_NE(ERR_IO_PENDING, data.result); | 1509 DCHECK_NE(ERR_IO_PENDING, data.result); |
1509 // Since we've been waiting for data, need_read_data_ should be true. | 1510 // Since we've been waiting for data, need_read_data_ should be true. |
1510 DCHECK(need_read_data_); | 1511 DCHECK(need_read_data_); |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 | 1842 |
1842 const char kSOCKS5OkRequest[] = | 1843 const char kSOCKS5OkRequest[] = |
1843 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; | 1844 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; |
1844 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); | 1845 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); |
1845 | 1846 |
1846 const char kSOCKS5OkResponse[] = | 1847 const char kSOCKS5OkResponse[] = |
1847 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; | 1848 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; |
1848 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); | 1849 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); |
1849 | 1850 |
1850 } // namespace net | 1851 } // namespace net |
OLD | NEW |