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

Side by Side Diff: net/spdy/spdy_test_util_spdy3.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: Add TODO 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_spdy3.h ('k') | net/spdy/spdy_websocket_stream_spdy2_unittest.cc » ('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_spdy3.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/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 21
21 namespace test_spdy3 { 22 namespace test_spdy3 {
22 23
23 // Chop a frame into an array of MockWrites. 24 // Chop a frame into an array of MockWrites.
24 // |data| is the frame to chop. 25 // |data| is the frame to chop.
25 // |length| is the length of the frame to chop. 26 // |length| is the length of the frame to chop.
26 // |num_chunks| is the number of chunks to create. 27 // |num_chunks| is the number of chunks to create.
27 MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) { 28 MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) {
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 spdy::CONTROL_FLAG_FIN, // Control Flags 1001 spdy::CONTROL_FLAG_FIN, // Control Flags
1001 false, // Compressed 1002 false, // Compressed
1002 spdy::INVALID, // Status 1003 spdy::INVALID, // Status
1003 NULL, // Data 1004 NULL, // Data
1004 0, // Length 1005 0, // Length
1005 spdy::DATA_FLAG_NONE // Data Flags 1006 spdy::DATA_FLAG_NONE // Data Flags
1006 }; 1007 };
1007 return kHeader; 1008 return kHeader;
1008 } 1009 }
1009 1010
1011 SpdyTestStateHelper::SpdyTestStateHelper() {
1012 // Pings can be non-deterministic, because they are sent via timer.
1013 SpdySession::set_enable_ping_based_connection_checking(false);
1014 // Compression is per-session which makes it impossible to create
1015 // SPDY frames with static methods.
1016 spdy::SpdyFramer::set_enable_compression_default(false);
1017 }
1018
1019 SpdyTestStateHelper::~SpdyTestStateHelper() {
1020 SpdySession::ResetStaticSettingsToInit();
1021 // TODO(rch): save/restore this value
1022 spdy::SpdyFramer::set_enable_compression_default(true);
1023 }
1024
1010 } // namespace test_spdy3 1025 } // namespace test_spdy3
1011 1026
1012 } // namespace net 1027 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_test_util_spdy3.h ('k') | net/spdy/spdy_websocket_stream_spdy2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698