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 #ifndef HEADLESS_PUBLIC_UTIL_TESTING_GENERIC_URL_REQUEST_MOCKS_H_ | 5 #ifndef HEADLESS_PUBLIC_UTIL_TESTING_GENERIC_URL_REQUEST_MOCKS_H_ |
6 #define HEADLESS_PUBLIC_UTIL_TESTING_GENERIC_URL_REQUEST_MOCKS_H_ | 6 #define HEADLESS_PUBLIC_UTIL_TESTING_GENERIC_URL_REQUEST_MOCKS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 public: | 24 public: |
25 MockGenericURLRequestJobDelegate(); | 25 MockGenericURLRequestJobDelegate(); |
26 ~MockGenericURLRequestJobDelegate() override; | 26 ~MockGenericURLRequestJobDelegate() override; |
27 | 27 |
28 // GenericURLRequestJob::Delegate methods: | 28 // GenericURLRequestJob::Delegate methods: |
29 void OnPendingRequest(PendingRequest* pending_request) override; | 29 void OnPendingRequest(PendingRequest* pending_request) override; |
30 void OnResourceLoadFailed(const Request* request, net::Error error) override; | 30 void OnResourceLoadFailed(const Request* request, net::Error error) override; |
31 void OnResourceLoadComplete( | 31 void OnResourceLoadComplete( |
32 const Request* request, | 32 const Request* request, |
33 const GURL& final_url, | 33 const GURL& final_url, |
34 int http_response_code, | |
35 scoped_refptr<net::HttpResponseHeaders> response_headers, | 34 scoped_refptr<net::HttpResponseHeaders> response_headers, |
36 const char* body, | 35 const char* body, |
37 size_t body_size) override; | 36 size_t body_size) override; |
38 | 37 |
39 using Policy = base::Callback<void(PendingRequest* pending_request)>; | 38 using Policy = base::Callback<void(PendingRequest* pending_request)>; |
40 | 39 |
41 void SetPolicy(Policy policy); | 40 void SetPolicy(Policy policy); |
42 | 41 |
43 private: | 42 private: |
44 void ApplyPolicy(PendingRequest* pending_request); | 43 void ApplyPolicy(PendingRequest* pending_request); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 140 |
142 private: | 141 private: |
143 std::string response_data_; | 142 std::string response_data_; |
144 | 143 |
145 DISALLOW_COPY_AND_ASSIGN(MockURLRequestDelegate); | 144 DISALLOW_COPY_AND_ASSIGN(MockURLRequestDelegate); |
146 }; | 145 }; |
147 | 146 |
148 } // namespace headless | 147 } // namespace headless |
149 | 148 |
150 #endif // HEADLESS_PUBLIC_UTIL_TESTING_GENERIC_URL_REQUEST_MOCKS_H_ | 149 #endif // HEADLESS_PUBLIC_UTIL_TESTING_GENERIC_URL_REQUEST_MOCKS_H_ |
OLD | NEW |