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_UTIL_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 private: | 88 private: |
89 const scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 89 const scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
90 scoped_ptr<TestURLRequestContext> context_; | 90 scoped_ptr<TestURLRequestContext> context_; |
91 }; | 91 }; |
92 | 92 |
93 //----------------------------------------------------------------------------- | 93 //----------------------------------------------------------------------------- |
94 | 94 |
95 class TestURLRequest : public net::URLRequest { | 95 class TestURLRequest : public net::URLRequest { |
96 public: | 96 public: |
97 TestURLRequest(const GURL& url, Delegate* delegate); | 97 TestURLRequest( |
| 98 const GURL& url, Delegate* delegate, TestURLRequestContext* context); |
98 virtual ~TestURLRequest(); | 99 virtual ~TestURLRequest(); |
99 | |
100 private: | |
101 const scoped_ptr<net::URLRequestContext> context_; | |
102 }; | 100 }; |
103 | 101 |
104 //----------------------------------------------------------------------------- | 102 //----------------------------------------------------------------------------- |
105 | 103 |
106 class TestDelegate : public net::URLRequest::Delegate { | 104 class TestDelegate : public net::URLRequest::Delegate { |
107 public: | 105 public: |
108 TestDelegate(); | 106 TestDelegate(); |
109 virtual ~TestDelegate(); | 107 virtual ~TestDelegate(); |
110 | 108 |
111 void set_cancel_in_received_redirect(bool val) { cancel_in_rr_ = val; } | 109 void set_cancel_in_received_redirect(bool val) { cancel_in_rr_ = val; } |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 290 |
293 private: | 291 private: |
294 static std::string value_; | 292 static std::string value_; |
295 const std::string old_value_; | 293 const std::string old_value_; |
296 const std::string new_value_; | 294 const std::string new_value_; |
297 | 295 |
298 DISALLOW_COPY_AND_ASSIGN(ScopedCustomUrlRequestTestHttpHost); | 296 DISALLOW_COPY_AND_ASSIGN(ScopedCustomUrlRequestTestHttpHost); |
299 }; | 297 }; |
300 | 298 |
301 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 299 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
OLD | NEW |