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

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

Issue 1135553003: Change DeterministicSocketData to no longer inherit from SocketDataProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « net/socket/socket_test_util.cc ('k') | no next file » | 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 265 }
266 266
267 // Most tests will want to call this function. In particular, the MockReads 267 // Most tests will want to call this function. In particular, the MockReads
268 // should end with an empty read, and that read needs to be processed to 268 // should end with an empty read, and that read needs to be processed to
269 // ensure proper deletion of the spdy_session_pool. 269 // ensure proper deletion of the spdy_session_pool.
270 void VerifyDataConsumed() { 270 void VerifyDataConsumed() {
271 for (const SocketDataProvider* provider : data_vector_) { 271 for (const SocketDataProvider* provider : data_vector_) {
272 EXPECT_TRUE(provider->AllReadDataConsumed()); 272 EXPECT_TRUE(provider->AllReadDataConsumed());
273 EXPECT_TRUE(provider->AllWriteDataConsumed()); 273 EXPECT_TRUE(provider->AllWriteDataConsumed());
274 } 274 }
275 for (const SocketDataProvider* provider : deterministic_data_vector_) { 275 for (const DeterministicSocketData* provider :
276 deterministic_data_vector_) {
276 EXPECT_TRUE(provider->AllReadDataConsumed()); 277 EXPECT_TRUE(provider->AllReadDataConsumed());
277 EXPECT_TRUE(provider->AllWriteDataConsumed()); 278 EXPECT_TRUE(provider->AllWriteDataConsumed());
278 } 279 }
279 } 280 }
280 281
281 // Occasionally a test will expect to error out before certain reads are 282 // Occasionally a test will expect to error out before certain reads are
282 // processed. In that case we want to explicitly ensure that the reads were 283 // processed. In that case we want to explicitly ensure that the reads were
283 // not processed. 284 // not processed.
284 void VerifyDataNotConsumed() { 285 void VerifyDataNotConsumed() {
285 for (const SocketDataProvider* provider : data_vector_) { 286 for (const SocketDataProvider* provider : data_vector_) {
286 EXPECT_FALSE(provider->AllReadDataConsumed()); 287 EXPECT_FALSE(provider->AllReadDataConsumed());
287 EXPECT_FALSE(provider->AllWriteDataConsumed()); 288 EXPECT_FALSE(provider->AllWriteDataConsumed());
288 } 289 }
289 for (const SocketDataProvider* provider : deterministic_data_vector_) { 290 for (const DeterministicSocketData* provider :
291 deterministic_data_vector_) {
290 EXPECT_FALSE(provider->AllReadDataConsumed()); 292 EXPECT_FALSE(provider->AllReadDataConsumed());
291 EXPECT_FALSE(provider->AllWriteDataConsumed()); 293 EXPECT_FALSE(provider->AllWriteDataConsumed());
292 } 294 }
293 } 295 }
294 296
295 void RunToCompletion(SocketDataProvider* data) { 297 void RunToCompletion(SocketDataProvider* data) {
296 RunPreTestSetup(); 298 RunPreTestSetup();
297 AddData(data); 299 AddData(data);
298 RunDefaultTest(); 300 RunDefaultTest();
299 VerifyDataConsumed(); 301 VerifyDataConsumed();
(...skipping 6295 matching lines...) Expand 10 before | Expand all | Expand 10 after
6595 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { 6597 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) {
6596 scoped_ptr<SSLSocketDataProvider> ssl_provider( 6598 scoped_ptr<SSLSocketDataProvider> ssl_provider(
6597 new SSLSocketDataProvider(ASYNC, OK)); 6599 new SSLSocketDataProvider(ASYNC, OK));
6598 // Set to TLS_RSA_WITH_NULL_MD5 6600 // Set to TLS_RSA_WITH_NULL_MD5
6599 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); 6601 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status);
6600 6602
6601 RunTLSUsageCheckTest(ssl_provider.Pass()); 6603 RunTLSUsageCheckTest(ssl_provider.Pass());
6602 } 6604 }
6603 6605
6604 } // namespace net 6606 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socket_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698