| 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 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <shlobj.h> | 8 #include <shlobj.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif | 10 #endif |
| (...skipping 2072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2083 : intercept_main_request_(false), restart_main_request_(false), | 2083 : intercept_main_request_(false), restart_main_request_(false), |
| 2084 cancel_main_request_(false), cancel_then_restart_main_request_(false), | 2084 cancel_main_request_(false), cancel_then_restart_main_request_(false), |
| 2085 simulate_main_network_error_(false), | 2085 simulate_main_network_error_(false), |
| 2086 intercept_redirect_(false), cancel_redirect_request_(false), | 2086 intercept_redirect_(false), cancel_redirect_request_(false), |
| 2087 intercept_final_response_(false), cancel_final_request_(false), | 2087 intercept_final_response_(false), cancel_final_request_(false), |
| 2088 did_intercept_main_(false), did_restart_main_(false), | 2088 did_intercept_main_(false), did_restart_main_(false), |
| 2089 did_cancel_main_(false), did_cancel_then_restart_main_(false), | 2089 did_cancel_main_(false), did_cancel_then_restart_main_(false), |
| 2090 did_simulate_error_main_(false), | 2090 did_simulate_error_main_(false), |
| 2091 did_intercept_redirect_(false), did_cancel_redirect_(false), | 2091 did_intercept_redirect_(false), did_cancel_redirect_(false), |
| 2092 did_intercept_final_(false), did_cancel_final_(false) { | 2092 did_intercept_final_(false), did_cancel_final_(false) { |
| 2093 URLRequest::RegisterRequestInterceptor(this); | 2093 URLRequest::Deprecated::RegisterRequestInterceptor(this); |
| 2094 } | 2094 } |
| 2095 | 2095 |
| 2096 ~TestInterceptor() { | 2096 ~TestInterceptor() { |
| 2097 URLRequest::UnregisterRequestInterceptor(this); | 2097 URLRequest::Deprecated::UnregisterRequestInterceptor(this); |
| 2098 } | 2098 } |
| 2099 | 2099 |
| 2100 virtual URLRequestJob* MaybeIntercept(URLRequest* request) { | 2100 virtual URLRequestJob* MaybeIntercept(URLRequest* request) { |
| 2101 if (restart_main_request_) { | 2101 if (restart_main_request_) { |
| 2102 restart_main_request_ = false; | 2102 restart_main_request_ = false; |
| 2103 did_restart_main_ = true; | 2103 did_restart_main_ = true; |
| 2104 return new RestartTestJob(request); | 2104 return new RestartTestJob(request); |
| 2105 } | 2105 } |
| 2106 if (cancel_main_request_) { | 2106 if (cancel_main_request_) { |
| 2107 cancel_main_request_ = false; | 2107 cancel_main_request_ = false; |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3095 req.SetExtraRequestHeaders(headers); | 3095 req.SetExtraRequestHeaders(headers); |
| 3096 req.Start(); | 3096 req.Start(); |
| 3097 MessageLoop::current()->Run(); | 3097 MessageLoop::current()->Run(); |
| 3098 // If the net tests are being run with ChromeFrame then we need to allow for | 3098 // If the net tests are being run with ChromeFrame then we need to allow for |
| 3099 // the 'chromeframe' suffix which is added to the user agent before the | 3099 // the 'chromeframe' suffix which is added to the user agent before the |
| 3100 // closing parentheses. | 3100 // closing parentheses. |
| 3101 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); | 3101 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); |
| 3102 } | 3102 } |
| 3103 | 3103 |
| 3104 } // namespace net | 3104 } // namespace net |
| OLD | NEW |