| 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 "base/memory/scoped_vector.h" | 5 #include "base/memory/scoped_vector.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "net/proxy/proxy_config_service.h" | 7 #include "net/proxy/proxy_config_service.h" |
| 8 #include "net/socket/socket_test_util.h" | 8 #include "net/socket/socket_test_util.h" |
| 9 #include "net/url_request/url_request.h" | 9 #include "net/url_request/url_request.h" |
| 10 #include "net/url_request/url_request_context.h" | 10 #include "net/url_request/url_request_context.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 MockWrite(ASYNC, 0, "GET ftp://ftp.example.com/first HTTP/1.1\r\n" | 300 MockWrite(ASYNC, 0, "GET ftp://ftp.example.com/first HTTP/1.1\r\n" |
| 301 "Host: ftp.example.com\r\n" | 301 "Host: ftp.example.com\r\n" |
| 302 "Proxy-Connection: keep-alive\r\n\r\n"), | 302 "Proxy-Connection: keep-alive\r\n\r\n"), |
| 303 }; | 303 }; |
| 304 MockWrite writes2[] = { | 304 MockWrite writes2[] = { |
| 305 MockWrite(ASYNC, 0, "GET /second HTTP/1.1\r\n" | 305 MockWrite(ASYNC, 0, "GET /second HTTP/1.1\r\n" |
| 306 "Host: ftp.example.com\r\n" | 306 "Host: ftp.example.com\r\n" |
| 307 "Connection: keep-alive\r\n" | 307 "Connection: keep-alive\r\n" |
| 308 "User-Agent:\r\n" | 308 "User-Agent:\r\n" |
| 309 "Accept-Encoding: gzip,deflate\r\n" | 309 "Accept-Encoding: gzip,deflate\r\n" |
| 310 "Accept-Language: en-us,fr\r\n" | 310 "Accept-Language: en-us,fr\r\n\r\n"), |
| 311 "Accept-Charset: iso-8859-1,*,utf-8\r\n\r\n"), | |
| 312 }; | 311 }; |
| 313 MockRead reads1[] = { | 312 MockRead reads1[] = { |
| 314 MockRead(ASYNC, 1, "HTTP/1.1 200 OK\r\n"), | 313 MockRead(ASYNC, 1, "HTTP/1.1 200 OK\r\n"), |
| 315 MockRead(ASYNC, 2, "Content-Length: 10\r\n\r\n"), | 314 MockRead(ASYNC, 2, "Content-Length: 10\r\n\r\n"), |
| 316 MockRead(ASYNC, 3, "test1.html"), | 315 MockRead(ASYNC, 3, "test1.html"), |
| 317 }; | 316 }; |
| 318 MockRead reads2[] = { | 317 MockRead reads2[] = { |
| 319 MockRead(ASYNC, 1, "HTTP/1.1 200 OK\r\n"), | 318 MockRead(ASYNC, 1, "HTTP/1.1 200 OK\r\n"), |
| 320 MockRead(ASYNC, 2, "Content-Length: 10\r\n\r\n"), | 319 MockRead(ASYNC, 2, "Content-Length: 10\r\n\r\n"), |
| 321 MockRead(ASYNC, 3, "test2.html"), | 320 MockRead(ASYNC, 3, "test2.html"), |
| (...skipping 29 matching lines...) Expand all Loading... |
| 351 EXPECT_TRUE(url_request2.status().is_success()); | 350 EXPECT_TRUE(url_request2.status().is_success()); |
| 352 EXPECT_EQ(2, network_delegate()->completed_requests()); | 351 EXPECT_EQ(2, network_delegate()->completed_requests()); |
| 353 EXPECT_EQ(0, network_delegate()->error_count()); | 352 EXPECT_EQ(0, network_delegate()->error_count()); |
| 354 EXPECT_FALSE(request_delegate2.auth_required_called()); | 353 EXPECT_FALSE(request_delegate2.auth_required_called()); |
| 355 EXPECT_EQ("test2.html", request_delegate2.data_received()); | 354 EXPECT_EQ("test2.html", request_delegate2.data_received()); |
| 356 } | 355 } |
| 357 | 356 |
| 358 } // namespace | 357 } // namespace |
| 359 | 358 |
| 360 } // namespace net | 359 } // namespace net |
| OLD | NEW |