OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "net/url_request/url_request_test_job.h" | 7 #include "net/url_request/url_request_test_job.h" |
8 | 8 |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
| 12 #include "net/http/http_response_headers.h" |
12 #include "net/url_request/url_request.h" | 13 #include "net/url_request/url_request.h" |
13 | 14 |
14 // This emulates the global message loop for the test URL request class, since | 15 // This emulates the global message loop for the test URL request class, since |
15 // this is only test code, it's probably not too dangerous to have this static | 16 // this is only test code, it's probably not too dangerous to have this static |
16 // object. | 17 // object. |
17 static std::vector< scoped_refptr<URLRequestTestJob> > pending_jobs; | 18 static std::vector< scoped_refptr<URLRequestTestJob> > pending_jobs; |
18 | 19 |
19 // static getters for known URLs | 20 // static getters for known URLs |
20 GURL URLRequestTestJob::test_url_1() { | 21 GURL URLRequestTestJob::test_url_1() { |
21 return GURL("test:url1"); | 22 return GURL("test:url1"); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 169 |
169 scoped_refptr<URLRequestTestJob> next_job(pending_jobs[0]); | 170 scoped_refptr<URLRequestTestJob> next_job(pending_jobs[0]); |
170 pending_jobs.erase(pending_jobs.begin()); | 171 pending_jobs.erase(pending_jobs.begin()); |
171 | 172 |
172 if (next_job->ProcessNextOperation()) | 173 if (next_job->ProcessNextOperation()) |
173 pending_jobs.push_back(next_job); | 174 pending_jobs.push_back(next_job); |
174 | 175 |
175 return true; | 176 return true; |
176 } | 177 } |
177 | 178 |
OLD | NEW |