OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 5 #ifndef NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
6 #define NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 6 #define NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 class CTPolicyEnforcer; | 46 class CTPolicyEnforcer; |
47 class HostPortPair; | 47 class HostPortPair; |
48 class SpdySession; | 48 class SpdySession; |
49 class SpdySessionKey; | 49 class SpdySessionKey; |
50 class SpdySessionPool; | 50 class SpdySessionPool; |
51 class SpdyStream; | 51 class SpdyStream; |
52 class SpdyStreamRequest; | 52 class SpdyStreamRequest; |
53 | 53 |
54 // Default upload data used by both, mock objects and framer when creating | 54 // Default upload data used by both, mock objects and framer when creating |
55 // data frames. | 55 // data frames. |
56 const char kDefaultURL[] = "http://www.example.org/"; | 56 const char kDefaultUrl[] = "https://www.example.org/"; |
57 const char kUploadData[] = "hello!"; | 57 const char kUploadData[] = "hello!"; |
58 const int kUploadDataSize = arraysize(kUploadData)-1; | 58 const int kUploadDataSize = arraysize(kUploadData)-1; |
59 | 59 |
60 // Chop a SpdySerializedFrame into an array of MockWrites. | 60 // Chop a SpdySerializedFrame into an array of MockWrites. |
61 // |frame| is the frame to chop. | 61 // |frame| is the frame to chop. |
62 // |num_chunks| is the number of chunks to create. | 62 // |num_chunks| is the number of chunks to create. |
63 MockWrite* ChopWriteFrame(const SpdySerializedFrame& frame, int num_chunks); | 63 MockWrite* ChopWriteFrame(const SpdySerializedFrame& frame, int num_chunks); |
64 | 64 |
65 // Adds headers and values to a map. | 65 // Adds headers and values to a map. |
66 // |extra_headers| is an array of { name, value } pairs, arranged as strings | 66 // |extra_headers| is an array of { name, value } pairs, arranged as strings |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 std::unique_ptr<MockClientSocketFactory> socket_factory; | 200 std::unique_ptr<MockClientSocketFactory> socket_factory; |
201 std::unique_ptr<HttpAuthHandlerFactory> http_auth_handler_factory; | 201 std::unique_ptr<HttpAuthHandlerFactory> http_auth_handler_factory; |
202 std::unique_ptr<HttpServerPropertiesImpl> http_server_properties; | 202 std::unique_ptr<HttpServerPropertiesImpl> http_server_properties; |
203 bool enable_ip_pooling; | 203 bool enable_ip_pooling; |
204 bool enable_ping; | 204 bool enable_ping; |
205 bool enable_user_alternate_protocol_ports; | 205 bool enable_user_alternate_protocol_ports; |
206 bool enable_npn; | 206 bool enable_npn; |
207 bool enable_priority_dependencies; | 207 bool enable_priority_dependencies; |
208 bool enable_spdy31; | 208 bool enable_spdy31; |
209 bool enable_quic; | 209 bool enable_quic; |
210 bool enable_alternative_service_for_insecure_origins; | |
211 NextProto protocol; | 210 NextProto protocol; |
212 size_t session_max_recv_window_size; | 211 size_t session_max_recv_window_size; |
213 size_t stream_max_recv_window_size; | 212 size_t stream_max_recv_window_size; |
214 SpdySession::TimeFunc time_func; | 213 SpdySession::TimeFunc time_func; |
215 std::unique_ptr<ProxyDelegate> proxy_delegate; | 214 std::unique_ptr<ProxyDelegate> proxy_delegate; |
216 bool enable_http2_alternative_service_with_different_host; | 215 bool enable_http2_alternative_service_with_different_host; |
217 NetLog* net_log; | 216 NetLog* net_log; |
218 }; | 217 }; |
219 | 218 |
220 class SpdyURLRequestContext : public URLRequestContext { | 219 class SpdyURLRequestContext : public URLRequestContext { |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 // For versions below SPDY4, adds the version HTTP/1.1 header. | 520 // For versions below SPDY4, adds the version HTTP/1.1 header. |
522 void MaybeAddVersionHeader(SpdyHeaderBlock* block) const; | 521 void MaybeAddVersionHeader(SpdyHeaderBlock* block) const; |
523 | 522 |
524 // Maps |priority| to SPDY version priority, and sets it on |frame_ir|. | 523 // Maps |priority| to SPDY version priority, and sets it on |frame_ir|. |
525 void SetPriority(RequestPriority priority, SpdySynStreamIR* frame_ir) const; | 524 void SetPriority(RequestPriority priority, SpdySynStreamIR* frame_ir) const; |
526 | 525 |
527 NextProto protocol() const { return protocol_; } | 526 NextProto protocol() const { return protocol_; } |
528 SpdyMajorVersion spdy_version() const { return spdy_version_; } | 527 SpdyMajorVersion spdy_version() const { return spdy_version_; } |
529 bool include_version_header() const { return protocol_ < kProtoHTTP2; } | 528 bool include_version_header() const { return protocol_ < kProtoHTTP2; } |
530 | 529 |
531 const GURL& default_url() const { return default_url_; } | |
532 void set_default_url(const GURL& url) { default_url_ = url; } | 530 void set_default_url(const GURL& url) { default_url_ = url; } |
533 | 531 |
534 const char* GetMethodKey() const; | 532 const char* GetMethodKey() const; |
535 const char* GetStatusKey() const; | 533 const char* GetStatusKey() const; |
536 const char* GetHostKey() const; | 534 const char* GetHostKey() const; |
537 const char* GetSchemeKey() const; | 535 const char* GetSchemeKey() const; |
538 const char* GetVersionKey() const; | 536 const char* GetVersionKey() const; |
539 const char* GetPathKey() const; | 537 const char* GetPathKey() const; |
540 | 538 |
541 private: | 539 private: |
(...skipping 18 matching lines...) Expand all Loading... |
560 GURL default_url_; | 558 GURL default_url_; |
561 bool dependency_priorities_; | 559 bool dependency_priorities_; |
562 | 560 |
563 // Track a FIFO list of the stream_id of all created requests by priority. | 561 // Track a FIFO list of the stream_id of all created requests by priority. |
564 std::map<int, std::vector<int>> priority_to_stream_id_list_; | 562 std::map<int, std::vector<int>> priority_to_stream_id_list_; |
565 }; | 563 }; |
566 | 564 |
567 } // namespace net | 565 } // namespace net |
568 | 566 |
569 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 567 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
OLD | NEW |