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 "headless/public/util/generic_url_request_job.h" | 5 #include "headless/public/util/generic_url_request_job.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 job_delegate_(job_delegate), | 130 job_delegate_(job_delegate), |
131 dispatcher_(dispatcher) {} | 131 dispatcher_(dispatcher) {} |
132 | 132 |
133 // net::URLRequestJobFactory::ProtocolHandler override. | 133 // net::URLRequestJobFactory::ProtocolHandler override. |
134 net::URLRequestJob* MaybeCreateJob( | 134 net::URLRequestJob* MaybeCreateJob( |
135 net::URLRequest* request, | 135 net::URLRequest* request, |
136 net::NetworkDelegate* network_delegate) const override { | 136 net::NetworkDelegate* network_delegate) const override { |
137 return new GenericURLRequestJob( | 137 return new GenericURLRequestJob( |
138 request, network_delegate, dispatcher_, | 138 request, network_delegate, dispatcher_, |
139 base::MakeUnique<MockFetcher>(fetch_request_, json_fetch_reply_map_), | 139 base::MakeUnique<MockFetcher>(fetch_request_, json_fetch_reply_map_), |
140 job_delegate_); | 140 job_delegate_, nullptr); |
141 } | 141 } |
142 | 142 |
143 private: | 143 private: |
144 base::DictionaryValue* fetch_request_; // NOT OWNED | 144 base::DictionaryValue* fetch_request_; // NOT OWNED |
145 std::map<std::string, std::string>* json_fetch_reply_map_; // NOT OWNED | 145 std::map<std::string, std::string>* json_fetch_reply_map_; // NOT OWNED |
146 GenericURLRequestJob::Delegate* job_delegate_; // NOT OWNED | 146 GenericURLRequestJob::Delegate* job_delegate_; // NOT OWNED |
147 URLRequestDispatcher* dispatcher_; // NOT OWNED | 147 URLRequestDispatcher* dispatcher_; // NOT OWNED |
148 }; | 148 }; |
149 | 149 |
150 } // namespace | 150 } // namespace |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 pending_request->AllowRequest(); | 655 pending_request->AllowRequest(); |
656 }, | 656 }, |
657 &post_data)); | 657 &post_data)); |
658 | 658 |
659 CreateAndCompletePostJob(GURL("https://example.com"), "payload", reply); | 659 CreateAndCompletePostJob(GURL("https://example.com"), "payload", reply); |
660 | 660 |
661 EXPECT_EQ("payload", post_data); | 661 EXPECT_EQ("payload", post_data); |
662 } | 662 } |
663 | 663 |
664 } // namespace headless | 664 } // namespace headless |
OLD | NEW |