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 "net/url_request/url_request_ftp_job.h" | 5 #include "net/url_request/url_request_ftp_job.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "net/base/host_port_pair.h" | 10 #include "net/base/host_port_pair.h" |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 MockWrite writes1[] = { | 652 MockWrite writes1[] = { |
653 MockWrite(ASYNC, 0, "GET ftp://ftp.example.com/first HTTP/1.1\r\n" | 653 MockWrite(ASYNC, 0, "GET ftp://ftp.example.com/first HTTP/1.1\r\n" |
654 "Host: ftp.example.com\r\n" | 654 "Host: ftp.example.com\r\n" |
655 "Proxy-Connection: keep-alive\r\n\r\n"), | 655 "Proxy-Connection: keep-alive\r\n\r\n"), |
656 }; | 656 }; |
657 MockWrite writes2[] = { | 657 MockWrite writes2[] = { |
658 MockWrite(ASYNC, 0, "GET /second HTTP/1.1\r\n" | 658 MockWrite(ASYNC, 0, "GET /second HTTP/1.1\r\n" |
659 "Host: ftp.example.com\r\n" | 659 "Host: ftp.example.com\r\n" |
660 "Connection: keep-alive\r\n" | 660 "Connection: keep-alive\r\n" |
661 "User-Agent:\r\n" | 661 "User-Agent:\r\n" |
662 "Accept-Encoding: gzip,deflate\r\n" | 662 "Accept-Encoding: gzip, deflate\r\n" |
663 "Accept-Language: en-us,fr\r\n\r\n"), | 663 "Accept-Language: en-us,fr\r\n\r\n"), |
664 }; | 664 }; |
665 MockRead reads1[] = { | 665 MockRead reads1[] = { |
666 MockRead(ASYNC, 1, "HTTP/1.1 200 OK\r\n"), | 666 MockRead(ASYNC, 1, "HTTP/1.1 200 OK\r\n"), |
667 MockRead(ASYNC, 2, "Content-Length: 10\r\n\r\n"), | 667 MockRead(ASYNC, 2, "Content-Length: 10\r\n\r\n"), |
668 MockRead(ASYNC, 3, "test1.html"), | 668 MockRead(ASYNC, 3, "test1.html"), |
669 }; | 669 }; |
670 MockRead reads2[] = { | 670 MockRead reads2[] = { |
671 MockRead(ASYNC, 1, "HTTP/1.1 200 OK\r\n"), | 671 MockRead(ASYNC, 1, "HTTP/1.1 200 OK\r\n"), |
672 MockRead(ASYNC, 2, "Content-Length: 10\r\n\r\n"), | 672 MockRead(ASYNC, 2, "Content-Length: 10\r\n\r\n"), |
(...skipping 28 matching lines...) Expand all Loading... |
701 EXPECT_TRUE(url_request2->status().is_success()); | 701 EXPECT_TRUE(url_request2->status().is_success()); |
702 EXPECT_EQ(2, network_delegate()->completed_requests()); | 702 EXPECT_EQ(2, network_delegate()->completed_requests()); |
703 EXPECT_EQ(0, network_delegate()->error_count()); | 703 EXPECT_EQ(0, network_delegate()->error_count()); |
704 EXPECT_FALSE(request_delegate2.auth_required_called()); | 704 EXPECT_FALSE(request_delegate2.auth_required_called()); |
705 EXPECT_EQ("test2.html", request_delegate2.data_received()); | 705 EXPECT_EQ("test2.html", request_delegate2.data_received()); |
706 } | 706 } |
707 | 707 |
708 } // namespace | 708 } // namespace |
709 | 709 |
710 } // namespace net | 710 } // namespace net |
OLD | NEW |