OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "net/spdy/spdy_test_util_spdy2.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "net/http/http_network_session.h" | 13 #include "net/http/http_network_session.h" |
14 #include "net/http/http_network_transaction.h" | 14 #include "net/http/http_network_transaction.h" |
15 #include "net/http/http_server_properties_impl.h" | 15 #include "net/http/http_server_properties_impl.h" |
16 #include "net/spdy/spdy_framer.h" | 16 #include "net/spdy/spdy_framer.h" |
17 #include "net/spdy/spdy_http_utils.h" | 17 #include "net/spdy/spdy_http_utils.h" |
18 | 18 |
19 namespace net { | 19 namespace net { |
| 20 namespace test_spdy2 { |
20 | 21 |
21 // Chop a frame into an array of MockWrites. | 22 // Chop a frame into an array of MockWrites. |
22 // |data| is the frame to chop. | 23 // |data| is the frame to chop. |
23 // |length| is the length of the frame to chop. | 24 // |length| is the length of the frame to chop. |
24 // |num_chunks| is the number of chunks to create. | 25 // |num_chunks| is the number of chunks to create. |
25 MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) { | 26 MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) { |
26 MockWrite* chunks = new MockWrite[num_chunks]; | 27 MockWrite* chunks = new MockWrite[num_chunks]; |
27 int chunk_size = length / num_chunks; | 28 int chunk_size = length / num_chunks; |
28 for (int index = 0; index < num_chunks; index++) { | 29 for (int index = 0; index < num_chunks; index++) { |
29 const char* ptr = data + (index * chunk_size); | 30 const char* ptr = data + (index * chunk_size); |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 2, // Priority | 998 2, // Priority |
998 spdy::CONTROL_FLAG_FIN, // Control Flags | 999 spdy::CONTROL_FLAG_FIN, // Control Flags |
999 false, // Compressed | 1000 false, // Compressed |
1000 spdy::INVALID, // Status | 1001 spdy::INVALID, // Status |
1001 NULL, // Data | 1002 NULL, // Data |
1002 0, // Length | 1003 0, // Length |
1003 spdy::DATA_FLAG_NONE // Data Flags | 1004 spdy::DATA_FLAG_NONE // Data Flags |
1004 }; | 1005 }; |
1005 return kHeader; | 1006 return kHeader; |
1006 } | 1007 } |
| 1008 |
| 1009 } // namespace test_spdy2 |
1007 } // namespace net | 1010 } // namespace net |
OLD | NEW |