Chromium Code Reviews| 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(); | |
| 72 static GURL test_url_redirect_to_url_2(); | 73 static GURL test_url_redirect_to_url_2(); |
|
mmenke
2016/12/01 16:37:18
It's not documented here, but we can't use test_ur
| |
| 73 | 74 |
| 74 // The data that corresponds to each of the URLs above | 75 // The data that corresponds to each of the URLs above |
| 75 static std::string test_data_1(); | 76 static std::string test_data_1(); |
| 76 static std::string test_data_2(); | 77 static std::string test_data_2(); |
| 77 static std::string test_data_3(); | 78 static std::string test_data_3(); |
| 78 static std::string test_data_4(); | 79 static std::string test_data_4(); |
| 79 | 80 |
| 80 // The headers that correspond to each of the URLs above | 81 // The headers that correspond to each of the URLs above |
| 81 static std::string test_headers(); | 82 static std::string test_headers(); |
| 82 | 83 |
| 83 // The headers for a redirect response | 84 // The headers for a redirect response |
| 84 static std::string test_redirect_headers(); | 85 static std::string test_redirect_headers(); |
| 85 | 86 |
| 87 // The headers for a redirect response to the first test url. | |
| 88 static std::string test_redirect_to_url_1_headers(); | |
| 89 | |
| 86 // The headers for a redirect response to the second test url. | 90 // The headers for a redirect response to the second test url. |
| 87 static std::string test_redirect_to_url_2_headers(); | 91 static std::string test_redirect_to_url_2_headers(); |
| 88 | 92 |
| 89 // The headers for a server error response | 93 // The headers for a server error response |
| 90 static std::string test_error_headers(); | 94 static std::string test_error_headers(); |
| 91 | 95 |
| 92 // Processes one pending message from the stack, returning true if any | 96 // Processes one pending message from the stack, returning true if any |
| 93 // message was processed, or false if there are no more pending request | 97 // message was processed, or false if there are no more pending request |
| 94 // notifications to send. This is not applicable when using auto_advance. | 98 // notifications to send. This is not applicable when using auto_advance. |
| 95 static bool ProcessOnePendingMessage(); | 99 static bool ProcessOnePendingMessage(); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 | 177 |
| 174 // Original size in bytes of the response headers before decoding. | 178 // Original size in bytes of the response headers before decoding. |
| 175 int response_headers_length_; | 179 int response_headers_length_; |
| 176 | 180 |
| 177 base::WeakPtrFactory<URLRequestTestJob> weak_factory_; | 181 base::WeakPtrFactory<URLRequestTestJob> weak_factory_; |
| 178 }; | 182 }; |
| 179 | 183 |
| 180 } // namespace net | 184 } // namespace net |
| 181 | 185 |
| 182 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ | 186 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ |
| OLD | NEW |