| 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 #include "net/spdy/spdy_test_util_common.h" | 5 #include "net/spdy/spdy_test_util_common.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 block["hello"] = "bye"; | 994 block["hello"] = "bye"; |
| 995 AppendToHeaderBlock(extra_headers, extra_header_count, &block); | 995 AppendToHeaderBlock(extra_headers, extra_header_count, &block); |
| 996 | 996 |
| 997 return ConstructSpdyReply(stream_id, std::move(block)); | 997 return ConstructSpdyReply(stream_id, std::move(block)); |
| 998 } | 998 } |
| 999 | 999 |
| 1000 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGetReplyRedirect(int stream_id) { | 1000 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGetReplyRedirect(int stream_id) { |
| 1001 static const char* const kExtraHeaders[] = { | 1001 static const char* const kExtraHeaders[] = { |
| 1002 "location", "http://www.foo.com/index.php", | 1002 "location", "http://www.foo.com/index.php", |
| 1003 }; | 1003 }; |
| 1004 return ConstructSpdyReplyError("301 Moved Permanently", kExtraHeaders, | 1004 return ConstructSpdyReplyError("301", kExtraHeaders, |
| 1005 arraysize(kExtraHeaders) / 2, stream_id); | 1005 arraysize(kExtraHeaders) / 2, stream_id); |
| 1006 } | 1006 } |
| 1007 | 1007 |
| 1008 SpdySerializedFrame SpdyTestUtil::ConstructSpdyReplyError(int stream_id) { | 1008 SpdySerializedFrame SpdyTestUtil::ConstructSpdyReplyError(int stream_id) { |
| 1009 return ConstructSpdyReplyError("500 Internal Server Error", NULL, 0, 1); | 1009 return ConstructSpdyReplyError("500", NULL, 0, 1); |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGetReply( | 1012 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGetReply( |
| 1013 const char* const extra_headers[], | 1013 const char* const extra_headers[], |
| 1014 int extra_header_count, | 1014 int extra_header_count, |
| 1015 int stream_id) { | 1015 int stream_id) { |
| 1016 SpdyHeaderBlock block; | 1016 SpdyHeaderBlock block; |
| 1017 block[GetStatusKey()] = "200"; | 1017 block[GetStatusKey()] = "200"; |
| 1018 block["hello"] = "bye"; | 1018 block["hello"] = "bye"; |
| 1019 AppendToHeaderBlock(extra_headers, extra_header_count, &block); | 1019 AppendToHeaderBlock(extra_headers, extra_header_count, &block); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 headers[GetSchemeKey()] = scheme.c_str(); | 1137 headers[GetSchemeKey()] = scheme.c_str(); |
| 1138 headers[GetPathKey()] = path.c_str(); | 1138 headers[GetPathKey()] = path.c_str(); |
| 1139 if (content_length) { | 1139 if (content_length) { |
| 1140 std::string length_str = base::Int64ToString(*content_length); | 1140 std::string length_str = base::Int64ToString(*content_length); |
| 1141 headers["content-length"] = length_str; | 1141 headers["content-length"] = length_str; |
| 1142 } | 1142 } |
| 1143 return headers; | 1143 return headers; |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 } // namespace net | 1146 } // namespace net |
| OLD | NEW |