| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 // Creates a second transaction. | 245 // Creates a second transaction. |
| 246 job->Start(); | 246 job->Start(); |
| 247 ASSERT_TRUE(network_layer_.last_transaction()); | 247 ASSERT_TRUE(network_layer_.last_transaction()); |
| 248 EXPECT_EQ(LOW, network_layer_.last_transaction()->priority()); | 248 EXPECT_EQ(LOW, network_layer_.last_transaction()->priority()); |
| 249 } | 249 } |
| 250 | 250 |
| 251 class URLRequestFtpJobTest : public testing::Test { | 251 class URLRequestFtpJobTest : public testing::Test { |
| 252 public: | 252 public: |
| 253 URLRequestFtpJobTest() | 253 URLRequestFtpJobTest() |
| 254 : request_context_(&socket_factory_, | 254 : request_context_(&socket_factory_, |
| 255 base::WrapUnique(new ProxyService( | 255 base::MakeUnique<ProxyService>( |
| 256 base::WrapUnique(new SimpleProxyConfigService), | 256 base::WrapUnique(new SimpleProxyConfigService), |
| 257 NULL, | 257 nullptr, |
| 258 NULL)), | 258 nullptr), |
| 259 &network_delegate_, | 259 &network_delegate_, |
| 260 &ftp_transaction_factory_) {} | 260 &ftp_transaction_factory_) {} |
| 261 | 261 |
| 262 ~URLRequestFtpJobTest() override { | 262 ~URLRequestFtpJobTest() override { |
| 263 // Clean up any remaining tasks that mess up unrelated tests. | 263 // Clean up any remaining tasks that mess up unrelated tests. |
| 264 base::RunLoop().RunUntilIdle(); | 264 base::RunLoop().RunUntilIdle(); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void AddSocket(MockRead* reads, size_t reads_size, | 267 void AddSocket(MockRead* reads, size_t reads_size, |
| 268 MockWrite* writes, size_t writes_size) { | 268 MockWrite* writes, size_t writes_size) { |
| 269 std::unique_ptr<SequencedSocketData> socket_data(base::WrapUnique( | 269 std::unique_ptr<SequencedSocketData> socket_data( |
| 270 new SequencedSocketData(reads, reads_size, writes, writes_size))); | 270 base::MakeUnique<SequencedSocketData>(reads, reads_size, writes, |
| 271 writes_size)); |
| 271 socket_data->set_connect_data(MockConnect(SYNCHRONOUS, OK)); | 272 socket_data->set_connect_data(MockConnect(SYNCHRONOUS, OK)); |
| 272 socket_factory_.AddSocketDataProvider(socket_data.get()); | 273 socket_factory_.AddSocketDataProvider(socket_data.get()); |
| 273 | 274 |
| 274 socket_data_.push_back(std::move(socket_data)); | 275 socket_data_.push_back(std::move(socket_data)); |
| 275 } | 276 } |
| 276 | 277 |
| 277 FtpTestURLRequestContext* request_context() { return &request_context_; } | 278 FtpTestURLRequestContext* request_context() { return &request_context_; } |
| 278 TestNetworkDelegate* network_delegate() { return &network_delegate_; } | 279 TestNetworkDelegate* network_delegate() { return &network_delegate_; } |
| 279 | 280 |
| 280 private: | 281 private: |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 EXPECT_TRUE(url_request2->status().is_success()); | 798 EXPECT_TRUE(url_request2->status().is_success()); |
| 798 EXPECT_EQ(2, network_delegate()->completed_requests()); | 799 EXPECT_EQ(2, network_delegate()->completed_requests()); |
| 799 EXPECT_EQ(0, network_delegate()->error_count()); | 800 EXPECT_EQ(0, network_delegate()->error_count()); |
| 800 EXPECT_FALSE(request_delegate2.auth_required_called()); | 801 EXPECT_FALSE(request_delegate2.auth_required_called()); |
| 801 EXPECT_EQ("test2.html", request_delegate2.data_received()); | 802 EXPECT_EQ("test2.html", request_delegate2.data_received()); |
| 802 } | 803 } |
| 803 | 804 |
| 804 } // namespace | 805 } // namespace |
| 805 | 806 |
| 806 } // namespace net | 807 } // namespace net |
| OLD | NEW |