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

Side by Side Diff: net/spdy/spdy_test_util_common.h

Issue 284423002: Remove HttpStreamFactory's NPN/SPDY globals, except for spdy_enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge Created 6 years, 7 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_network_transaction_unittest.cc ('k') | net/spdy/spdy_test_util_common.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) 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 #ifndef NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ 5 #ifndef NET_SPDY_SPDY_TEST_UTIL_COMMON_H_
6 #define NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ 6 #define NET_SPDY_SPDY_TEST_UTIL_COMMON_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class SpdyStreamRequest; 43 class SpdyStreamRequest;
44 44
45 // Default upload data used by both, mock objects and framer when creating 45 // Default upload data used by both, mock objects and framer when creating
46 // data frames. 46 // data frames.
47 const char kDefaultURL[] = "http://www.google.com"; 47 const char kDefaultURL[] = "http://www.google.com";
48 const char kUploadData[] = "hello!"; 48 const char kUploadData[] = "hello!";
49 const int kUploadDataSize = arraysize(kUploadData)-1; 49 const int kUploadDataSize = arraysize(kUploadData)-1;
50 50
51 // SpdyNextProtos returns a vector of next protocols for negotiating 51 // SpdyNextProtos returns a vector of next protocols for negotiating
52 // SPDY. 52 // SPDY.
53 std::vector<NextProto> SpdyNextProtos(); 53 NextProtoVector SpdyNextProtos();
54 54
55 // Chop a frame into an array of MockWrites. 55 // Chop a frame into an array of MockWrites.
56 // |data| is the frame to chop. 56 // |data| is the frame to chop.
57 // |length| is the length of the frame to chop. 57 // |length| is the length of the frame to chop.
58 // |num_chunks| is the number of chunks to create. 58 // |num_chunks| is the number of chunks to create.
59 MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks); 59 MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks);
60 60
61 // Chop a SpdyFrame into an array of MockWrites. 61 // Chop a SpdyFrame into an array of MockWrites.
62 // |frame| is the frame to chop. 62 // |frame| is the frame to chop.
63 // |num_chunks| is the number of chunks to create. 63 // |num_chunks| is the number of chunks to create.
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 scoped_ptr<DeterministicMockClientSocketFactory> deterministic_socket_factory; 211 scoped_ptr<DeterministicMockClientSocketFactory> deterministic_socket_factory;
212 scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory; 212 scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory;
213 HttpServerPropertiesImpl http_server_properties; 213 HttpServerPropertiesImpl http_server_properties;
214 bool enable_ip_pooling; 214 bool enable_ip_pooling;
215 bool enable_compression; 215 bool enable_compression;
216 bool enable_ping; 216 bool enable_ping;
217 bool enable_user_alternate_protocol_ports; 217 bool enable_user_alternate_protocol_ports;
218 NextProto protocol; 218 NextProto protocol;
219 size_t stream_initial_recv_window_size; 219 size_t stream_initial_recv_window_size;
220 SpdySession::TimeFunc time_func; 220 SpdySession::TimeFunc time_func;
221 NextProtoVector next_protos;
221 std::string trusted_spdy_proxy; 222 std::string trusted_spdy_proxy;
223 bool force_spdy_over_ssl;
224 bool force_spdy_always;
225 bool use_alternate_protocols;
222 NetLog* net_log; 226 NetLog* net_log;
223 }; 227 };
224 228
225 class SpdyURLRequestContext : public URLRequestContext { 229 class SpdyURLRequestContext : public URLRequestContext {
226 public: 230 public:
227 explicit SpdyURLRequestContext(NextProto protocol); 231 SpdyURLRequestContext(NextProto protocol,
232 bool force_spdy_over_ssl,
233 bool force_spdy_always);
228 virtual ~SpdyURLRequestContext(); 234 virtual ~SpdyURLRequestContext();
229 235
230 MockClientSocketFactory& socket_factory() { return socket_factory_; } 236 MockClientSocketFactory& socket_factory() { return socket_factory_; }
231 237
232 private: 238 private:
233 MockClientSocketFactory socket_factory_; 239 MockClientSocketFactory socket_factory_;
234 net::URLRequestContextStorage storage_; 240 net::URLRequestContextStorage storage_;
235 }; 241 };
236 242
237 // Equivalent to pool->GetIfExists(spdy_session_key, BoundNetLog()) != NULL. 243 // Equivalent to pool->GetIfExists(spdy_session_key, BoundNetLog()) != NULL.
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 base::StringPiece url, 545 base::StringPiece url,
540 int64* content_length) const; 546 int64* content_length) const;
541 547
542 const NextProto protocol_; 548 const NextProto protocol_;
543 const SpdyMajorVersion spdy_version_; 549 const SpdyMajorVersion spdy_version_;
544 }; 550 };
545 551
546 } // namespace net 552 } // namespace net
547 553
548 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ 554 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_network_transaction_unittest.cc ('k') | net/spdy/spdy_test_util_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698