| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/tests/test_tcp_socket_private.h" | 5 #include "ppapi/tests/test_tcp_socket_private.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
| 10 #include "ppapi/c/dev/ppb_url_util_dev.h" | 10 #include "ppapi/c/dev/ppb_url_util_dev.h" |
| 11 #include "ppapi/cpp/dev/url_util_dev.h" | 11 #include "ppapi/cpp/dev/url_util_dev.h" |
| 12 #include "ppapi/cpp/private/flash_tcp_socket.h" | 12 #include "ppapi/cpp/private/tcp_socket_private.h" |
| 13 #include "ppapi/cpp/var.h" | 13 #include "ppapi/cpp/var.h" |
| 14 #include "ppapi/tests/testing_instance.h" | 14 #include "ppapi/tests/testing_instance.h" |
| 15 #include "ppapi/tests/test_utils.h" | 15 #include "ppapi/tests/test_utils.h" |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 // Validates the first line of an HTTP response. | 19 // Validates the first line of an HTTP response. |
| 20 bool ValidateHttpResponse(const std::string& s) { | 20 bool ValidateHttpResponse(const std::string& s) { |
| 21 // Just check that it begins with "HTTP/" and ends with a "\r\n". | 21 // Just check that it begins with "HTTP/" and ends with a "\r\n". |
| 22 return s.size() >= 5 && | 22 return s.size() >= 5 && |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 if (rv < 0) | 208 if (rv < 0) |
| 209 return rv; | 209 return rv; |
| 210 if (rv == 0) | 210 if (rv == 0) |
| 211 return PP_ERROR_FAILED; | 211 return PP_ERROR_FAILED; |
| 212 written += rv; | 212 written += rv; |
| 213 } | 213 } |
| 214 if (written != s.size()) | 214 if (written != s.size()) |
| 215 return PP_ERROR_FAILED; | 215 return PP_ERROR_FAILED; |
| 216 return PP_OK; | 216 return PP_OK; |
| 217 } | 217 } |
| OLD | NEW |