| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 10 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 bool MockClientSocket::IsConnected() const { | 143 bool MockClientSocket::IsConnected() const { |
| 144 return connected_; | 144 return connected_; |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool MockClientSocket::IsConnectedAndIdle() const { | 147 bool MockClientSocket::IsConnectedAndIdle() const { |
| 148 return connected_; | 148 return connected_; |
| 149 } | 149 } |
| 150 | 150 |
| 151 int MockClientSocket::GetPeerAddress(AddressList* address) const { | 151 int MockClientSocket::GetPeerAddress(AddressList* address) const { |
| 152 return net::SystemHostResolverProc("localhost", ADDRESS_FAMILY_UNSPECIFIED, | 152 return net::SystemHostResolverProc("192.0.2.33", ADDRESS_FAMILY_UNSPECIFIED, |
| 153 0, address, NULL); | 153 0, address, NULL); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void MockClientSocket::RunCallbackAsync(net::CompletionCallback* callback, | 156 void MockClientSocket::RunCallbackAsync(net::CompletionCallback* callback, |
| 157 int result) { | 157 int result) { |
| 158 MessageLoop::current()->PostTask(FROM_HERE, | 158 MessageLoop::current()->PostTask(FROM_HERE, |
| 159 method_factory_.NewRunnableMethod( | 159 method_factory_.NewRunnableMethod( |
| 160 &MockClientSocket::RunCallback, callback, result)); | 160 &MockClientSocket::RunCallback, callback, result)); |
| 161 } | 161 } |
| 162 | 162 |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 | 1290 |
| 1291 const char kSOCKS5OkRequest[] = | 1291 const char kSOCKS5OkRequest[] = |
| 1292 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; | 1292 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; |
| 1293 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); | 1293 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); |
| 1294 | 1294 |
| 1295 const char kSOCKS5OkResponse[] = | 1295 const char kSOCKS5OkResponse[] = |
| 1296 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; | 1296 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; |
| 1297 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); | 1297 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); |
| 1298 | 1298 |
| 1299 } // namespace net | 1299 } // namespace net |
| OLD | NEW |