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 #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 <windows.h> | 8 #include <windows.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 #endif | 10 #endif |
(...skipping 2936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2947 | 2947 |
2948 { | 2948 { |
2949 GURL original_url(test_server_.GetURL("empty.html")); | 2949 GURL original_url(test_server_.GetURL("empty.html")); |
2950 URLRequest r(original_url, DEFAULT_PRIORITY, &d, &context); | 2950 URLRequest r(original_url, DEFAULT_PRIORITY, &d, &context); |
2951 | 2951 |
2952 r.Start(); | 2952 r.Start(); |
2953 base::RunLoop().Run(); | 2953 base::RunLoop().Run(); |
2954 | 2954 |
2955 EXPECT_EQ(URLRequestStatus::SUCCESS, r.status().status()); | 2955 EXPECT_EQ(URLRequestStatus::SUCCESS, r.status().status()); |
2956 EXPECT_TRUE(r.proxy_server().Equals(test_server_.host_port_pair())); | 2956 EXPECT_TRUE(r.proxy_server().Equals(test_server_.host_port_pair())); |
| 2957 EXPECT_EQ( |
| 2958 1, network_delegate.observed_before_proxy_headers_sent_callbacks()); |
| 2959 EXPECT_TRUE( |
| 2960 network_delegate.last_observed_proxy().Equals( |
| 2961 test_server_.host_port_pair())); |
| 2962 |
2957 EXPECT_EQ(0, r.status().error()); | 2963 EXPECT_EQ(0, r.status().error()); |
2958 EXPECT_EQ(redirect_url, r.url()); | 2964 EXPECT_EQ(redirect_url, r.url()); |
2959 EXPECT_EQ(original_url, r.original_url()); | 2965 EXPECT_EQ(original_url, r.original_url()); |
2960 EXPECT_EQ(2U, r.url_chain().size()); | 2966 EXPECT_EQ(2U, r.url_chain().size()); |
2961 EXPECT_EQ(1, network_delegate.created_requests()); | 2967 EXPECT_EQ(1, network_delegate.created_requests()); |
2962 EXPECT_EQ(0, network_delegate.destroyed_requests()); | 2968 EXPECT_EQ(0, network_delegate.destroyed_requests()); |
2963 } | 2969 } |
2964 EXPECT_EQ(1, network_delegate.destroyed_requests()); | 2970 EXPECT_EQ(1, network_delegate.destroyed_requests()); |
2965 } | 2971 } |
2966 | 2972 |
(...skipping 13 matching lines...) Expand all Loading... |
2980 | 2986 |
2981 { | 2987 { |
2982 GURL original_url(test_server_.GetURL("empty.html")); | 2988 GURL original_url(test_server_.GetURL("empty.html")); |
2983 URLRequest r(original_url, DEFAULT_PRIORITY, &d, &context); | 2989 URLRequest r(original_url, DEFAULT_PRIORITY, &d, &context); |
2984 | 2990 |
2985 r.Start(); | 2991 r.Start(); |
2986 base::RunLoop().Run(); | 2992 base::RunLoop().Run(); |
2987 | 2993 |
2988 EXPECT_EQ(URLRequestStatus::SUCCESS, r.status().status()); | 2994 EXPECT_EQ(URLRequestStatus::SUCCESS, r.status().status()); |
2989 EXPECT_TRUE(r.proxy_server().Equals(test_server_.host_port_pair())); | 2995 EXPECT_TRUE(r.proxy_server().Equals(test_server_.host_port_pair())); |
| 2996 EXPECT_EQ( |
| 2997 1, network_delegate.observed_before_proxy_headers_sent_callbacks()); |
| 2998 EXPECT_TRUE( |
| 2999 network_delegate.last_observed_proxy().Equals( |
| 3000 test_server_.host_port_pair())); |
2990 EXPECT_EQ(0, r.status().error()); | 3001 EXPECT_EQ(0, r.status().error()); |
2991 EXPECT_EQ(redirect_url, r.url()); | 3002 EXPECT_EQ(redirect_url, r.url()); |
2992 EXPECT_EQ(original_url, r.original_url()); | 3003 EXPECT_EQ(original_url, r.original_url()); |
2993 EXPECT_EQ(2U, r.url_chain().size()); | 3004 EXPECT_EQ(2U, r.url_chain().size()); |
2994 EXPECT_EQ(1, network_delegate.created_requests()); | 3005 EXPECT_EQ(1, network_delegate.created_requests()); |
2995 EXPECT_EQ(0, network_delegate.destroyed_requests()); | 3006 EXPECT_EQ(0, network_delegate.destroyed_requests()); |
2996 } | 3007 } |
2997 EXPECT_EQ(1, network_delegate.destroyed_requests()); | 3008 EXPECT_EQ(1, network_delegate.destroyed_requests()); |
2998 } | 3009 } |
2999 | 3010 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3056 | 3067 |
3057 { | 3068 { |
3058 GURL original_url(test_server_.GetURL("empty.html")); | 3069 GURL original_url(test_server_.GetURL("empty.html")); |
3059 URLRequest r(original_url, DEFAULT_PRIORITY, &d, &context); | 3070 URLRequest r(original_url, DEFAULT_PRIORITY, &d, &context); |
3060 | 3071 |
3061 r.Start(); | 3072 r.Start(); |
3062 base::RunLoop().Run(); | 3073 base::RunLoop().Run(); |
3063 | 3074 |
3064 EXPECT_EQ(URLRequestStatus::SUCCESS, r.status().status()); | 3075 EXPECT_EQ(URLRequestStatus::SUCCESS, r.status().status()); |
3065 EXPECT_TRUE(r.proxy_server().Equals(test_server_.host_port_pair())); | 3076 EXPECT_TRUE(r.proxy_server().Equals(test_server_.host_port_pair())); |
| 3077 EXPECT_EQ( |
| 3078 2, network_delegate.observed_before_proxy_headers_sent_callbacks()); |
| 3079 EXPECT_TRUE( |
| 3080 network_delegate.last_observed_proxy().Equals( |
| 3081 test_server_.host_port_pair())); |
3066 EXPECT_EQ(net::OK, r.status().error()); | 3082 EXPECT_EQ(net::OK, r.status().error()); |
3067 EXPECT_EQ(redirect_url, r.url()); | 3083 EXPECT_EQ(redirect_url, r.url()); |
3068 EXPECT_EQ(original_url, r.original_url()); | 3084 EXPECT_EQ(original_url, r.original_url()); |
3069 EXPECT_EQ(2U, r.url_chain().size()); | 3085 EXPECT_EQ(2U, r.url_chain().size()); |
3070 EXPECT_EQ(2, network_delegate.created_requests()); | 3086 EXPECT_EQ(2, network_delegate.created_requests()); |
3071 EXPECT_EQ(0, network_delegate.destroyed_requests()); | 3087 EXPECT_EQ(0, network_delegate.destroyed_requests()); |
3072 } | 3088 } |
3073 EXPECT_EQ(1, network_delegate.destroyed_requests()); | 3089 EXPECT_EQ(1, network_delegate.destroyed_requests()); |
3074 } | 3090 } |
3075 | 3091 |
(...skipping 4952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8028 | 8044 |
8029 EXPECT_FALSE(r.is_pending()); | 8045 EXPECT_FALSE(r.is_pending()); |
8030 EXPECT_EQ(1, d->response_started_count()); | 8046 EXPECT_EQ(1, d->response_started_count()); |
8031 EXPECT_FALSE(d->received_data_before_response()); | 8047 EXPECT_FALSE(d->received_data_before_response()); |
8032 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); | 8048 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); |
8033 } | 8049 } |
8034 } | 8050 } |
8035 #endif // !defined(DISABLE_FTP_SUPPORT) | 8051 #endif // !defined(DISABLE_FTP_SUPPORT) |
8036 | 8052 |
8037 } // namespace net | 8053 } // namespace net |
OLD | NEW |