| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 // This struct holds information used to construct spdy control and data frames. | 126 // This struct holds information used to construct spdy control and data frames. |
| 127 struct SpdyHeaderInfo { | 127 struct SpdyHeaderInfo { |
| 128 SpdyFrameType kind; | 128 SpdyFrameType kind; |
| 129 SpdyStreamId id; | 129 SpdyStreamId id; |
| 130 SpdyStreamId assoc_id; | 130 SpdyStreamId assoc_id; |
| 131 SpdyPriority priority; | 131 SpdyPriority priority; |
| 132 int weight; | 132 int weight; |
| 133 SpdyControlFlags control_flags; | 133 SpdyControlFlags control_flags; |
| 134 SpdyRstStreamStatus status; | 134 SpdyErrorCode error_code; |
| 135 const char* data; | 135 const char* data; |
| 136 uint32_t data_length; | 136 uint32_t data_length; |
| 137 SpdyDataFlags data_flags; | 137 SpdyDataFlags data_flags; |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 // An ECSignatureCreator that returns deterministic signatures. | 140 // An ECSignatureCreator that returns deterministic signatures. |
| 141 class MockECSignatureCreator : public crypto::ECSignatureCreator { | 141 class MockECSignatureCreator : public crypto::ECSignatureCreator { |
| 142 public: | 142 public: |
| 143 explicit MockECSignatureCreator(crypto::ECPrivateKey* key); | 143 explicit MockECSignatureCreator(crypto::ECPrivateKey* key); |
| 144 | 144 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 SpdySerializedFrame ConstructSpdyGoAway(); | 319 SpdySerializedFrame ConstructSpdyGoAway(); |
| 320 | 320 |
| 321 // Construct a SPDY GOAWAY frame with the specified last_good_stream_id. | 321 // Construct a SPDY GOAWAY frame with the specified last_good_stream_id. |
| 322 // Returns the constructed frame. The caller takes ownership of the frame. | 322 // Returns the constructed frame. The caller takes ownership of the frame. |
| 323 SpdySerializedFrame ConstructSpdyGoAway(SpdyStreamId last_good_stream_id); | 323 SpdySerializedFrame ConstructSpdyGoAway(SpdyStreamId last_good_stream_id); |
| 324 | 324 |
| 325 // Construct a SPDY GOAWAY frame with the specified last_good_stream_id, | 325 // Construct a SPDY GOAWAY frame with the specified last_good_stream_id, |
| 326 // status, and description. Returns the constructed frame. The caller takes | 326 // status, and description. Returns the constructed frame. The caller takes |
| 327 // ownership of the frame. | 327 // ownership of the frame. |
| 328 SpdySerializedFrame ConstructSpdyGoAway(SpdyStreamId last_good_stream_id, | 328 SpdySerializedFrame ConstructSpdyGoAway(SpdyStreamId last_good_stream_id, |
| 329 SpdyGoAwayStatus status, | 329 SpdyErrorCode error_code, |
| 330 const std::string& desc); | 330 const std::string& desc); |
| 331 | 331 |
| 332 // Construct a SPDY WINDOW_UPDATE frame. | 332 // Construct a SPDY WINDOW_UPDATE frame. |
| 333 // Returns the constructed frame. The caller takes ownership of the frame. | 333 // Returns the constructed frame. The caller takes ownership of the frame. |
| 334 SpdySerializedFrame ConstructSpdyWindowUpdate(SpdyStreamId stream_id, | 334 SpdySerializedFrame ConstructSpdyWindowUpdate(SpdyStreamId stream_id, |
| 335 uint32_t delta_window_size); | 335 uint32_t delta_window_size); |
| 336 | 336 |
| 337 // Construct a SPDY RST_STREAM frame. | 337 // Construct a SPDY RST_STREAM frame. |
| 338 // Returns the constructed frame. The caller takes ownership of the frame. | 338 // Returns the constructed frame. The caller takes ownership of the frame. |
| 339 SpdySerializedFrame ConstructSpdyRstStream(SpdyStreamId stream_id, | 339 SpdySerializedFrame ConstructSpdyRstStream(SpdyStreamId stream_id, |
| 340 SpdyRstStreamStatus status); | 340 SpdyErrorCode error_code); |
| 341 | 341 |
| 342 // Construct a PRIORITY frame. The weight is derived from |request_priority|. | 342 // Construct a PRIORITY frame. The weight is derived from |request_priority|. |
| 343 // Returns the constructed frame. The caller takes ownership of the frame. | 343 // Returns the constructed frame. The caller takes ownership of the frame. |
| 344 SpdySerializedFrame ConstructSpdyPriority(SpdyStreamId stream_id, | 344 SpdySerializedFrame ConstructSpdyPriority(SpdyStreamId stream_id, |
| 345 SpdyStreamId parent_stream_id, | 345 SpdyStreamId parent_stream_id, |
| 346 RequestPriority request_priority, | 346 RequestPriority request_priority, |
| 347 bool exclusive); | 347 bool exclusive); |
| 348 | 348 |
| 349 // Constructs a standard SPDY GET HEADERS frame for |url| with header | 349 // Constructs a standard SPDY GET HEADERS frame for |url| with header |
| 350 // compression. | 350 // compression. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 | 524 |
| 525 GURL default_url_; | 525 GURL default_url_; |
| 526 | 526 |
| 527 // Track a FIFO list of the stream_id of all created requests by priority. | 527 // Track a FIFO list of the stream_id of all created requests by priority. |
| 528 std::map<int, std::vector<int>> priority_to_stream_id_list_; | 528 std::map<int, std::vector<int>> priority_to_stream_id_list_; |
| 529 }; | 529 }; |
| 530 | 530 |
| 531 } // namespace net | 531 } // namespace net |
| 532 | 532 |
| 533 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 533 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
| OLD | NEW |