| 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_spdy3.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 | 20 |
| 21 namespace test_spdy3 { |
| 22 |
| 21 // Chop a frame into an array of MockWrites. | 23 // Chop a frame into an array of MockWrites. |
| 22 // |data| is the frame to chop. | 24 // |data| is the frame to chop. |
| 23 // |length| is the length of the frame to chop. | 25 // |length| is the length of the frame to chop. |
| 24 // |num_chunks| is the number of chunks to create. | 26 // |num_chunks| is the number of chunks to create. |
| 25 MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) { | 27 MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) { |
| 26 MockWrite* chunks = new MockWrite[num_chunks]; | 28 MockWrite* chunks = new MockWrite[num_chunks]; |
| 27 int chunk_size = length / num_chunks; | 29 int chunk_size = length / num_chunks; |
| 28 for (int index = 0; index < num_chunks; index++) { | 30 for (int index = 0; index < num_chunks; index++) { |
| 29 const char* ptr = data + (index * chunk_size); | 31 const char* ptr = data + (index * chunk_size); |
| 30 if (index == num_chunks - 1) | 32 if (index == num_chunks - 1) |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 2, // Priority | 999 2, // Priority |
| 998 spdy::CONTROL_FLAG_FIN, // Control Flags | 1000 spdy::CONTROL_FLAG_FIN, // Control Flags |
| 999 false, // Compressed | 1001 false, // Compressed |
| 1000 spdy::INVALID, // Status | 1002 spdy::INVALID, // Status |
| 1001 NULL, // Data | 1003 NULL, // Data |
| 1002 0, // Length | 1004 0, // Length |
| 1003 spdy::DATA_FLAG_NONE // Data Flags | 1005 spdy::DATA_FLAG_NONE // Data Flags |
| 1004 }; | 1006 }; |
| 1005 return kHeader; | 1007 return kHeader; |
| 1006 } | 1008 } |
| 1009 |
| 1010 } // namespace test_spdy3 |
| 1011 |
| 1007 } // namespace net | 1012 } // namespace net |
| OLD | NEW |