| 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 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2031 const int kSOCKS5GreetResponseLength = arraysize(kSOCKS5GreetResponse); | 2031 const int kSOCKS5GreetResponseLength = arraysize(kSOCKS5GreetResponse); |
| 2032 | 2032 |
| 2033 const char kSOCKS5OkRequest[] = | 2033 const char kSOCKS5OkRequest[] = |
| 2034 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; | 2034 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; |
| 2035 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); | 2035 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); |
| 2036 | 2036 |
| 2037 const char kSOCKS5OkResponse[] = | 2037 const char kSOCKS5OkResponse[] = |
| 2038 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; | 2038 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; |
| 2039 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); | 2039 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); |
| 2040 | 2040 |
| 2041 int64_t CountReadBytes(const MockRead reads[], size_t reads_size) { |
| 2042 int64_t total = 0; |
| 2043 for (const MockRead* read = reads; read != reads + reads_size; ++read) |
| 2044 total += read->data_len; |
| 2045 return total; |
| 2046 } |
| 2047 |
| 2048 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { |
| 2049 int64_t total = 0; |
| 2050 for (const MockWrite* write = writes; write != writes + writes_size; ++write) |
| 2051 total += write->data_len; |
| 2052 return total; |
| 2053 } |
| 2054 |
| 2041 } // namespace net | 2055 } // namespace net |
| OLD | NEW |