| 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 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 ~URLRequestTestJob() override; | 62 ~URLRequestTestJob() override; |
| 63 | 63 |
| 64 // The canned URLs this handler will respond to without having been | 64 // The canned URLs this handler will respond to without having been |
| 65 // explicitly initialized with response headers and data. | 65 // explicitly initialized with response headers and data. |
| 66 // FIXME(brettw): we should probably also have a redirect one | 66 // FIXME(brettw): we should probably also have a redirect one |
| 67 static GURL test_url_1(); | 67 static GURL test_url_1(); |
| 68 static GURL test_url_2(); | 68 static GURL test_url_2(); |
| 69 static GURL test_url_3(); | 69 static GURL test_url_3(); |
| 70 static GURL test_url_4(); | 70 static GURL test_url_4(); |
| 71 static GURL test_url_error(); | 71 static GURL test_url_error(); |
| 72 static GURL test_url_redirect_to_url_1(); | |
| 73 static GURL test_url_redirect_to_url_2(); | 72 static GURL test_url_redirect_to_url_2(); |
| 74 | 73 |
| 75 // The data that corresponds to each of the URLs above | 74 // The data that corresponds to each of the URLs above |
| 76 static std::string test_data_1(); | 75 static std::string test_data_1(); |
| 77 static std::string test_data_2(); | 76 static std::string test_data_2(); |
| 78 static std::string test_data_3(); | 77 static std::string test_data_3(); |
| 79 static std::string test_data_4(); | 78 static std::string test_data_4(); |
| 80 | 79 |
| 81 // The headers that correspond to each of the URLs above | 80 // The headers that correspond to each of the URLs above |
| 82 static std::string test_headers(); | 81 static std::string test_headers(); |
| 83 | 82 |
| 84 // The headers for a redirect response | 83 // The headers for a redirect response |
| 85 static std::string test_redirect_headers(); | 84 static std::string test_redirect_headers(); |
| 86 | 85 |
| 87 // The headers for a redirect response to the first test url. | |
| 88 static std::string test_redirect_to_url_1_headers(); | |
| 89 | |
| 90 // The headers for a redirect response to the second test url. | 86 // The headers for a redirect response to the second test url. |
| 91 static std::string test_redirect_to_url_2_headers(); | 87 static std::string test_redirect_to_url_2_headers(); |
| 92 | 88 |
| 93 // The headers for a server error response | 89 // The headers for a server error response |
| 94 static std::string test_error_headers(); | 90 static std::string test_error_headers(); |
| 95 | 91 |
| 96 // Processes one pending message from the stack, returning true if any | 92 // Processes one pending message from the stack, returning true if any |
| 97 // message was processed, or false if there are no more pending request | 93 // message was processed, or false if there are no more pending request |
| 98 // notifications to send. This is not applicable when using auto_advance. | 94 // notifications to send. This is not applicable when using auto_advance. |
| 99 static bool ProcessOnePendingMessage(); | 95 static bool ProcessOnePendingMessage(); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 173 |
| 178 // Original size in bytes of the response headers before decoding. | 174 // Original size in bytes of the response headers before decoding. |
| 179 int response_headers_length_; | 175 int response_headers_length_; |
| 180 | 176 |
| 181 base::WeakPtrFactory<URLRequestTestJob> weak_factory_; | 177 base::WeakPtrFactory<URLRequestTestJob> weak_factory_; |
| 182 }; | 178 }; |
| 183 | 179 |
| 184 } // namespace net | 180 } // namespace net |
| 185 | 181 |
| 186 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ | 182 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ |
| OLD | NEW |