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 #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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 // Optionally, you can also construct test jobs to return a headers and data | 29 // Optionally, you can also construct test jobs to return a headers and data |
30 // provided to the contstructor in response to any request url. | 30 // provided to the contstructor in response to any request url. |
31 // | 31 // |
32 // When a job is created, it gets put on a queue of pending test jobs. To | 32 // When a job is created, it gets put on a queue of pending test jobs. To |
33 // process jobs on this queue, use ProcessOnePendingMessage, which will process | 33 // process jobs on this queue, use ProcessOnePendingMessage, which will process |
34 // one step of the next job. If the job is incomplete, it will be added to the | 34 // one step of the next job. If the job is incomplete, it will be added to the |
35 // end of the queue. | 35 // end of the queue. |
36 // | 36 // |
37 // Optionally, you can also construct test jobs that advance automatically | 37 // Optionally, you can also construct test jobs that advance automatically |
38 // without having to call ProcessOnePendingMessage. | 38 // without having to call ProcessOnePendingMessage. |
39 class NET_TEST URLRequestTestJob : public URLRequestJob { | 39 class NET_EXPORT_PRIVATE URLRequestTestJob : public URLRequestJob { |
40 public: | 40 public: |
41 // Constructs a job to return one of the canned responses depending on the | 41 // Constructs a job to return one of the canned responses depending on the |
42 // request url, with auto advance disabled. | 42 // request url, with auto advance disabled. |
43 explicit URLRequestTestJob(URLRequest* request); | 43 explicit URLRequestTestJob(URLRequest* request); |
44 | 44 |
45 // Constructs a job to return one of the canned responses depending on the | 45 // Constructs a job to return one of the canned responses depending on the |
46 // request url, optionally with auto advance enabled. | 46 // request url, optionally with auto advance enabled. |
47 URLRequestTestJob(URLRequest* request, bool auto_advance); | 47 URLRequestTestJob(URLRequest* request, bool auto_advance); |
48 | 48 |
49 // Constructs a job to return the given response regardless of the request | 49 // Constructs a job to return the given response regardless of the request |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Holds the buffer for an asynchronous ReadRawData call | 135 // Holds the buffer for an asynchronous ReadRawData call |
136 IOBuffer* async_buf_; | 136 IOBuffer* async_buf_; |
137 int async_buf_size_; | 137 int async_buf_size_; |
138 | 138 |
139 ScopedRunnableMethodFactory<URLRequestTestJob> method_factory_; | 139 ScopedRunnableMethodFactory<URLRequestTestJob> method_factory_; |
140 }; | 140 }; |
141 | 141 |
142 } // namespace net | 142 } // namespace net |
143 | 143 |
144 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ | 144 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ |
OLD | NEW |