| 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 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <string> | |
| 14 #include <vector> | 13 #include <vector> |
| 15 | 14 |
| 16 #include "base/macros.h" | 15 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 18 #include "crypto/ec_private_key.h" | 17 #include "crypto/ec_private_key.h" |
| 19 #include "crypto/ec_signature_creator.h" | 18 #include "crypto/ec_signature_creator.h" |
| 20 #include "net/base/completion_callback.h" | 19 #include "net/base/completion_callback.h" |
| 21 #include "net/base/proxy_delegate.h" | 20 #include "net/base/proxy_delegate.h" |
| 22 #include "net/base/request_priority.h" | 21 #include "net/base/request_priority.h" |
| 23 #include "net/base/test_completion_callback.h" | 22 #include "net/base/test_completion_callback.h" |
| 24 #include "net/cert/cert_verifier.h" | 23 #include "net/cert/cert_verifier.h" |
| 25 #include "net/dns/mock_host_resolver.h" | 24 #include "net/dns/mock_host_resolver.h" |
| 26 #include "net/http/http_auth_handler_factory.h" | 25 #include "net/http/http_auth_handler_factory.h" |
| 27 #include "net/http/http_network_session.h" | 26 #include "net/http/http_network_session.h" |
| 28 #include "net/http/http_response_info.h" | 27 #include "net/http/http_response_info.h" |
| 29 #include "net/http/http_server_properties_impl.h" | 28 #include "net/http/http_server_properties_impl.h" |
| 30 #include "net/http/transport_security_state.h" | 29 #include "net/http/transport_security_state.h" |
| 31 #include "net/proxy/proxy_server.h" | 30 #include "net/proxy/proxy_server.h" |
| 32 #include "net/proxy/proxy_service.h" | 31 #include "net/proxy/proxy_service.h" |
| 33 #include "net/socket/socket_test_util.h" | 32 #include "net/socket/socket_test_util.h" |
| 33 #include "net/spdy/platform/api/spdy_string.h" |
| 34 #include "net/spdy/platform/api/spdy_string_piece.h" | 34 #include "net/spdy/platform/api/spdy_string_piece.h" |
| 35 #include "net/spdy/spdy_protocol.h" | 35 #include "net/spdy/spdy_protocol.h" |
| 36 #include "net/ssl/ssl_config_service_defaults.h" | 36 #include "net/ssl/ssl_config_service_defaults.h" |
| 37 #include "net/url_request/url_request_context.h" | 37 #include "net/url_request/url_request_context.h" |
| 38 #include "net/url_request/url_request_context_storage.h" | 38 #include "net/url_request/url_request_context_storage.h" |
| 39 #include "testing/gtest/include/gtest/gtest.h" | 39 #include "testing/gtest/include/gtest/gtest.h" |
| 40 | 40 |
| 41 class GURL; | 41 class GURL; |
| 42 | 42 |
| 43 namespace net { | 43 namespace net { |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 static SpdyHeaderBlock ConstructGetHeaderBlock(SpdyStringPiece url); | 306 static SpdyHeaderBlock ConstructGetHeaderBlock(SpdyStringPiece url); |
| 307 static SpdyHeaderBlock ConstructGetHeaderBlockForProxy(SpdyStringPiece url); | 307 static SpdyHeaderBlock ConstructGetHeaderBlockForProxy(SpdyStringPiece url); |
| 308 static SpdyHeaderBlock ConstructHeadHeaderBlock(SpdyStringPiece url, | 308 static SpdyHeaderBlock ConstructHeadHeaderBlock(SpdyStringPiece url, |
| 309 int64_t content_length); | 309 int64_t content_length); |
| 310 static SpdyHeaderBlock ConstructPostHeaderBlock(SpdyStringPiece url, | 310 static SpdyHeaderBlock ConstructPostHeaderBlock(SpdyStringPiece url, |
| 311 int64_t content_length); | 311 int64_t content_length); |
| 312 static SpdyHeaderBlock ConstructPutHeaderBlock(SpdyStringPiece url, | 312 static SpdyHeaderBlock ConstructPutHeaderBlock(SpdyStringPiece url, |
| 313 int64_t content_length); | 313 int64_t content_length); |
| 314 | 314 |
| 315 // Construct an expected SPDY reply string from the given headers. | 315 // Construct an expected SPDY reply string from the given headers. |
| 316 std::string ConstructSpdyReplyString(const SpdyHeaderBlock& headers) const; | 316 SpdyString ConstructSpdyReplyString(const SpdyHeaderBlock& headers) const; |
| 317 | 317 |
| 318 // Construct an expected SPDY SETTINGS frame. | 318 // Construct an expected SPDY SETTINGS frame. |
| 319 // |settings| are the settings to set. | 319 // |settings| are the settings to set. |
| 320 // Returns the constructed frame. The caller takes ownership of the frame. | 320 // Returns the constructed frame. The caller takes ownership of the frame. |
| 321 SpdySerializedFrame ConstructSpdySettings(const SettingsMap& settings); | 321 SpdySerializedFrame ConstructSpdySettings(const SettingsMap& settings); |
| 322 | 322 |
| 323 // Constructs an expected SPDY SETTINGS acknowledgement frame. | 323 // Constructs an expected SPDY SETTINGS acknowledgement frame. |
| 324 SpdySerializedFrame ConstructSpdySettingsAck(); | 324 SpdySerializedFrame ConstructSpdySettingsAck(); |
| 325 | 325 |
| 326 // Construct a SPDY PING frame. | 326 // Construct a SPDY PING frame. |
| 327 // Returns the constructed frame. The caller takes ownership of the frame. | 327 // Returns the constructed frame. The caller takes ownership of the frame. |
| 328 SpdySerializedFrame ConstructSpdyPing(uint32_t ping_id, bool is_ack); | 328 SpdySerializedFrame ConstructSpdyPing(uint32_t ping_id, bool is_ack); |
| 329 | 329 |
| 330 // Construct a SPDY GOAWAY frame with last_good_stream_id = 0. | 330 // Construct a SPDY GOAWAY frame with last_good_stream_id = 0. |
| 331 // Returns the constructed frame. The caller takes ownership of the frame. | 331 // Returns the constructed frame. The caller takes ownership of the frame. |
| 332 SpdySerializedFrame ConstructSpdyGoAway(); | 332 SpdySerializedFrame ConstructSpdyGoAway(); |
| 333 | 333 |
| 334 // Construct a SPDY GOAWAY frame with the specified last_good_stream_id. | 334 // Construct a SPDY GOAWAY frame with the specified last_good_stream_id. |
| 335 // Returns the constructed frame. The caller takes ownership of the frame. | 335 // Returns the constructed frame. The caller takes ownership of the frame. |
| 336 SpdySerializedFrame ConstructSpdyGoAway(SpdyStreamId last_good_stream_id); | 336 SpdySerializedFrame ConstructSpdyGoAway(SpdyStreamId last_good_stream_id); |
| 337 | 337 |
| 338 // Construct a SPDY GOAWAY frame with the specified last_good_stream_id, | 338 // Construct a SPDY GOAWAY frame with the specified last_good_stream_id, |
| 339 // status, and description. Returns the constructed frame. The caller takes | 339 // status, and description. Returns the constructed frame. The caller takes |
| 340 // ownership of the frame. | 340 // ownership of the frame. |
| 341 SpdySerializedFrame ConstructSpdyGoAway(SpdyStreamId last_good_stream_id, | 341 SpdySerializedFrame ConstructSpdyGoAway(SpdyStreamId last_good_stream_id, |
| 342 SpdyErrorCode error_code, | 342 SpdyErrorCode error_code, |
| 343 const std::string& desc); | 343 const SpdyString& desc); |
| 344 | 344 |
| 345 // Construct a SPDY WINDOW_UPDATE frame. | 345 // Construct a SPDY WINDOW_UPDATE frame. |
| 346 // Returns the constructed frame. The caller takes ownership of the frame. | 346 // Returns the constructed frame. The caller takes ownership of the frame. |
| 347 SpdySerializedFrame ConstructSpdyWindowUpdate(SpdyStreamId stream_id, | 347 SpdySerializedFrame ConstructSpdyWindowUpdate(SpdyStreamId stream_id, |
| 348 uint32_t delta_window_size); | 348 uint32_t delta_window_size); |
| 349 | 349 |
| 350 // Construct a SPDY RST_STREAM frame. | 350 // Construct a SPDY RST_STREAM frame. |
| 351 // Returns the constructed frame. The caller takes ownership of the frame. | 351 // Returns the constructed frame. The caller takes ownership of the frame. |
| 352 SpdySerializedFrame ConstructSpdyRstStream(SpdyStreamId stream_id, | 352 SpdySerializedFrame ConstructSpdyRstStream(SpdyStreamId stream_id, |
| 353 SpdyErrorCode error_code); | 353 SpdyErrorCode error_code); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 | 537 |
| 538 GURL default_url_; | 538 GURL default_url_; |
| 539 | 539 |
| 540 // Track a FIFO list of the stream_id of all created requests by priority. | 540 // Track a FIFO list of the stream_id of all created requests by priority. |
| 541 std::map<int, std::vector<int>> priority_to_stream_id_list_; | 541 std::map<int, std::vector<int>> priority_to_stream_id_list_; |
| 542 }; | 542 }; |
| 543 | 543 |
| 544 } // namespace net | 544 } // namespace net |
| 545 | 545 |
| 546 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 546 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
| OLD | NEW |