Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: net/spdy/spdy_test_util_spdy2.cc

Issue 9817014: Created a new class SpdyTestStateHelper to serve as a helper to manage the state of a number of SPD… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_test_util_spdy2.h ('k') | net/spdy/spdy_test_util_spdy3.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_spdy2.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/buffered_spdy_framer.h" 16 #include "net/spdy/buffered_spdy_framer.h"
17 #include "net/spdy/spdy_http_utils.h" 17 #include "net/spdy/spdy_http_utils.h"
18 #include "net/spdy/spdy_session.h"
18 19
19 namespace net { 20 namespace net {
20 namespace test_spdy2 { 21 namespace test_spdy2 {
21 22
22 // Chop a frame into an array of MockWrites. 23 // Chop a frame into an array of MockWrites.
23 // |data| is the frame to chop. 24 // |data| is the frame to chop.
24 // |length| is the length of the frame to chop. 25 // |length| is the length of the frame to chop.
25 // |num_chunks| is the number of chunks to create. 26 // |num_chunks| is the number of chunks to create.
26 MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) { 27 MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) {
27 MockWrite* chunks = new MockWrite[num_chunks]; 28 MockWrite* chunks = new MockWrite[num_chunks];
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 spdy::CONTROL_FLAG_FIN, // Control Flags 1000 spdy::CONTROL_FLAG_FIN, // Control Flags
1000 false, // Compressed 1001 false, // Compressed
1001 spdy::INVALID, // Status 1002 spdy::INVALID, // Status
1002 NULL, // Data 1003 NULL, // Data
1003 0, // Length 1004 0, // Length
1004 spdy::DATA_FLAG_NONE // Data Flags 1005 spdy::DATA_FLAG_NONE // Data Flags
1005 }; 1006 };
1006 return kHeader; 1007 return kHeader;
1007 } 1008 }
1008 1009
1010 SpdyTestStateHelper::SpdyTestStateHelper() {
willchan no longer on Chromium 2012/03/22 01:21:04 I dunno, it would feel cleaner to me if there were
Ryan Hamilton 2012/03/22 02:38:35 Added a TODO. I wonder if a ResetStatics() method
1011 // Pings can be non-deterministic, because they are sent via timer.
1012 SpdySession::set_enable_ping_based_connection_checking(false);
1013 // Compression is per-session which makes it impossible to create
1014 // SPDY frames with static methods.
1015 spdy::SpdyFramer::set_enable_compression_default(false);
1016 }
1017
1018 SpdyTestStateHelper::~SpdyTestStateHelper() {
1019 SpdySession::ResetStaticSettingsToInit();
1020 spdy::SpdyFramer::set_enable_compression_default(true);
1021 }
1022
1009 } // namespace test_spdy2 1023 } // namespace test_spdy2
1010 } // namespace net 1024 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_test_util_spdy2.h ('k') | net/spdy/spdy_test_util_spdy3.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698