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

Unified Diff: net/spdy/spdy_test_util_spdy3.h

Issue 11415219: Move a number of static variables SPDY to HttpNetworkSession::Params. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix flip_in_mem_edsm_server Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_test_util_spdy2.cc ('k') | net/spdy/spdy_test_util_spdy3.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_test_util_spdy3.h
diff --git a/net/spdy/spdy_test_util_spdy3.h b/net/spdy/spdy_test_util_spdy3.h
index d0a806afb8d990ca11fb240e806fc8ce25803384..5103c89883698b66c3a66eb02a070550d4804fd2 100644
--- a/net/spdy/spdy_test_util_spdy3.h
+++ b/net/spdy/spdy_test_util_spdy3.h
@@ -7,6 +7,8 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "crypto/ec_private_key.h"
+#include "crypto/ec_signature_creator.h"
#include "net/base/cert_verifier.h"
#include "net/base/host_port_pair.h"
#include "net/base/mock_host_resolver.h"
@@ -20,6 +22,7 @@
#include "net/http/http_transaction_factory.h"
#include "net/proxy/proxy_service.h"
#include "net/socket/socket_test_util.h"
+#include "net/spdy/spdy_session.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_storage.h"
@@ -53,6 +56,38 @@ struct SpdyHeaderInfo {
SpdyDataFlags data_flags;
};
+// An ECSignatureCreator that returns deterministic signatures.
+class MockECSignatureCreator : public crypto::ECSignatureCreator {
+ public:
+ explicit MockECSignatureCreator(crypto::ECPrivateKey* key);
+
+ // crypto::ECSignatureCreator
+ virtual bool Sign(const uint8* data,
+ int data_len,
+ std::vector<uint8>* signature) OVERRIDE;
+ virtual bool DecodeSignature(const std::vector<uint8>& signature,
+ std::vector<uint8>* out_raw_sig) OVERRIDE;
+
+ private:
+ crypto::ECPrivateKey* key_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockECSignatureCreator);
+};
+
+// An ECSignatureCreatorFactory creates MockECSignatureCreator.
+class MockECSignatureCreatorFactory : public crypto::ECSignatureCreatorFactory {
+ public:
+ MockECSignatureCreatorFactory();
+ virtual ~MockECSignatureCreatorFactory();
+
+ // crypto::ECSignatureCreatorFactory
+ virtual crypto::ECSignatureCreator* Create(
+ crypto::ECPrivateKey* key) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MockECSignatureCreatorFactory);
+};
+
// Chop a frame into an array of MockWrites.
// |data| is the frame to chop.
// |length| is the length of the frame to chop.
@@ -370,6 +405,11 @@ struct SpdySessionDependencies {
scoped_ptr<DeterministicMockClientSocketFactory> deterministic_socket_factory;
scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory;
HttpServerPropertiesImpl http_server_properties;
+ bool enable_ip_pooling;
+ bool enable_compression;
+ bool enable_ping;
+ size_t initial_recv_window_size;
+ SpdySession::TimeFunc time_func;
std::string trusted_spdy_proxy;
NetLog* net_log;
};
@@ -419,21 +459,6 @@ class SpdySessionPoolPeer {
DISALLOW_COPY_AND_ASSIGN(SpdySessionPoolPeer);
};
-// Helper to manage the state of a number of SPDY global variables.
-class SpdyTestStateHelper {
- public:
- SpdyTestStateHelper();
- ~SpdyTestStateHelper();
-
- private:
- // In order to make CREDENTIAL frame creation deterministic, we need to
- // use a mock EC signature creator, which needs to live throughout
- // the life of the test.
- scoped_ptr<crypto::ECSignatureCreatorFactory> ec_signature_creator_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(SpdyTestStateHelper);
-};
-
} // namespace test_spdy3
} // namespace net
« no previous file with comments | « net/spdy/spdy_test_util_spdy2.cc ('k') | net/spdy/spdy_test_util_spdy3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698