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

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

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 unified diff | Download patch | Annotate | Revision Log
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_credential_builder.h" 5 #include "net/spdy/spdy_credential_builder.h"
6 6
7 #include "base/threading/sequenced_worker_pool.h" 7 #include "base/threading/sequenced_worker_pool.h"
8 #include "crypto/ec_signature_creator.h" 8 #include "crypto/ec_signature_creator.h"
9 #include "crypto/ec_private_key.h" 9 #include "crypto/ec_private_key.h"
10 #include "net/base/asn1_util.h" 10 #include "net/base/asn1_util.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 int Build() { 63 int Build() {
64 return BuildWithType(CLIENT_CERT_ECDSA_SIGN); 64 return BuildWithType(CLIENT_CERT_ECDSA_SIGN);
65 } 65 }
66 66
67 std::string GetCredentialSecret() { 67 std::string GetCredentialSecret() {
68 return SpdyCredentialBuilder::GetCredentialSecret( 68 return SpdyCredentialBuilder::GetCredentialSecret(
69 MockClientSocket::kTlsUnique); 69 MockClientSocket::kTlsUnique);
70 } 70 }
71 71
72 SpdyTestStateHelper helper_; // Provides deterministic EC signatures.
73 std::string cert_; 72 std::string cert_;
74 std::string key_; 73 std::string key_;
75 SpdyCredential credential_; 74 SpdyCredential credential_;
75 MockECSignatureCreatorFactory ec_signature_creator_factory_;
76 }; 76 };
77 77
78 // http://crbug.com/142833, http://crbug.com/140991. The following tests fail 78 // http://crbug.com/142833, http://crbug.com/140991. The following tests fail
79 // with OpenSSL due to the unimplemented ec_private_key_openssl.cc. 79 // with OpenSSL due to the unimplemented ec_private_key_openssl.cc.
80 #if defined(USE_OPENSSL) 80 #if defined(USE_OPENSSL)
81 #define MAYBE_GetCredentialSecret DISABLED_GetCredentialSecret 81 #define MAYBE_GetCredentialSecret DISABLED_GetCredentialSecret
82 #else 82 #else
83 #define MAYBE_GetCredentialSecret GetCredentialSecret 83 #define MAYBE_GetCredentialSecret GetCredentialSecret
84 #endif 84 #endif
85 85
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 crypto::ECSignatureCreator::Create(private_key.get())); 162 crypto::ECSignatureCreator::Create(private_key.get()));
163 std::string secret = GetCredentialSecret(); 163 std::string secret = GetCredentialSecret();
164 creator->Sign(reinterpret_cast<const unsigned char *>(secret.data()), 164 creator->Sign(reinterpret_cast<const unsigned char *>(secret.data()),
165 secret.length(), &proof_data); 165 secret.length(), &proof_data);
166 166
167 std::string proof(proof_data.begin(), proof_data.end()); 167 std::string proof(proof_data.begin(), proof_data.end());
168 EXPECT_EQ(proof, credential_.proof); 168 EXPECT_EQ(proof, credential_.proof);
169 } 169 }
170 170
171 } // namespace net 171 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/buffered_spdy_framer_spdy3_unittest.cc ('k') | net/spdy/spdy_http_stream_spdy2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698