| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.h" | 5 #include "net/url_request/url_request.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
| 15 #include "base/test/fuzzed_data_provider.h" | 15 #include "base/test/fuzzed_data_provider.h" |
| 16 #include "net/base/request_priority.h" | 16 #include "net/base/request_priority.h" |
| 17 #include "net/dns/fuzzed_host_resolver.h" | 17 #include "net/dns/fuzzed_host_resolver.h" |
| 18 #include "net/ftp/ftp_network_transaction.h" | 18 #include "net/ftp/ftp_network_transaction.h" |
| 19 #include "net/ftp/ftp_transaction_factory.h" | 19 #include "net/ftp/ftp_transaction_factory.h" |
| 20 #include "net/socket/client_socket_factory.h" | 20 #include "net/socket/client_socket_factory.h" |
| 21 #include "net/socket/fuzzed_socket_factory.h" | 21 #include "net/socket/fuzzed_socket_factory.h" |
| 22 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" |
| 22 #include "net/url_request/ftp_protocol_handler.h" | 23 #include "net/url_request/ftp_protocol_handler.h" |
| 23 #include "net/url_request/url_request.h" | 24 #include "net/url_request/url_request.h" |
| 24 #include "net/url_request/url_request_context.h" | 25 #include "net/url_request/url_request_context.h" |
| 25 #include "net/url_request/url_request_job_factory_impl.h" | 26 #include "net/url_request/url_request_job_factory_impl.h" |
| 26 #include "net/url_request/url_request_test_util.h" | 27 #include "net/url_request/url_request_test_util.h" |
| 27 #include "url/gurl.h" | 28 #include "url/gurl.h" |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| 30 | 31 |
| 31 // Returns FtpNetworkTransactions using the specified HostResolver | 32 // Returns FtpNetworkTransactions using the specified HostResolver |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 &host_resolver, &fuzzed_socket_factory))); | 74 &host_resolver, &fuzzed_socket_factory))); |
| 74 url_request_context.set_job_factory(&job_factory); | 75 url_request_context.set_job_factory(&job_factory); |
| 75 | 76 |
| 76 url_request_context.Init(); | 77 url_request_context.Init(); |
| 77 | 78 |
| 78 net::TestDelegate delegate; | 79 net::TestDelegate delegate; |
| 79 | 80 |
| 80 std::unique_ptr<net::URLRequest> url_request( | 81 std::unique_ptr<net::URLRequest> url_request( |
| 81 url_request_context.CreateRequest( | 82 url_request_context.CreateRequest( |
| 82 GURL("ftp://foo/" + data_provider.ConsumeRandomLengthString(1000)), | 83 GURL("ftp://foo/" + data_provider.ConsumeRandomLengthString(1000)), |
| 83 net::DEFAULT_PRIORITY, &delegate)); | 84 net::DEFAULT_PRIORITY, &delegate, TRAFFIC_ANNOTATION_FOR_TESTS)); |
| 84 url_request->Start(); | 85 url_request->Start(); |
| 85 // TestDelegate quits the message loop on completion. | 86 // TestDelegate quits the message loop on completion. |
| 86 base::RunLoop().Run(); | 87 base::RunLoop().Run(); |
| 87 | 88 |
| 88 return 0; | 89 return 0; |
| 89 } | 90 } |
| OLD | NEW |